Re: Consensus on getter conventions?



-> In other words, it is hard to handle functions with multiple return/
-> output values, especially if the the values are of different types.

	Hmm... (at least for the Java bindings then) to adopt Karl's idea
we need an ammendment that says in/out parameters are limited to one.
Over time, that could mean a lot of 'custom' typedef'd structs used to
pass more than one value out of functions.

-> The main issue as I see it is figuring out whether a function returns
-> a static string or a dynamic. Why not just add a postfix '_s' to
-> methods which return static strings? And if compatibility with old
-> versions of GTK is to be kept, add a set of functions with '_d'
-> postfix as well.

	(Minor clarification: I don't think we're just talking about
gchar *strings, here.)

	Personally, I hate the idea of putting informational codes like
"_s" or "_d" into function (or even variable) names.  It reduces the
readability of the code and makes it less comfortable to newcomers.  It's
yet one-more-rule to remember about using Gtk+.  (Note that for all of
Hungarian notation's perceived informational benefit, hardly anyone uses
it because it's hard to read.)

	Is there any reason that returned pointers can't simply be const,
whereas data that needs to be freed is not const?


--Derek






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]