[Geany-devel] encoding combo boxes bug - utility functions

Nick Treleaven nick.treleaven at xxxxx
Mon Jan 23 16:30:09 UTC 2012


On 22/01/2012 22:00, Lex Trotman wrote:
> When working with a common well known library like GTK it is better to
> use the well known interface directly rather than creating private
> partial wrappers.
>
> Contributors who know GTK don't have to learn the private interface
> (or complain about what is missing, or just use GTK directly anyway
> since they don't know about the private interface) and contributors
> who don't know GTK can learn an interface that is useful to them
> elsewhere, rather than one that just works in Geany.

You make a valid point, but most contributions are from the core team 
that know our utility functions. In this case we're discussing a fairly 
trivial function, but if it gets used 10 or 50 times in the code base 
then that's a significant benefit in avoiding temporary variables or 
nested expressions, which are harder to read. As I said, if the function 
is obvious, there's no harm.

In other cases we have functions that save 10 lines of code per call. 
This is a massive help that outweighs having to work out what the 
function does.

Another point is that exposing Matt's ui_get_builder before we actually 
have code that needs it seems premature. We already know we need to 
lookup objects though, and that a short syntax is needed.

Nick



More information about the Devel mailing list