g_object_{new,set,get} vs. class-specific function

Richard Laager rlaager at wiktel.com
Sun May 20 12:42:46 EDT 2007


On Sun, 2007-05-20 at 11:48 +0300, Gabriel Schulhof wrote:
> You asked me why I prefer using GObject properties rather than
> class-specific accessors and constructors. A bit of an essay follows, so
> please feel free to ignore it and instruct me to use the class-specific
> functions in Pidgin :o)

(08:14:23) Richard: I guess my big concern is that the named functions
could have other logic that we're missing.

(08:15:07) Gabriel Schulhof: That's true. I have uncovered several GTK+
bugs wherein the "notify::<property>" signals were not being emitted
when the properties were being modified.

(08:15:55) Gabriel Schulhof: ... and if there /is/ such other logic,
then that constitutes a GTK+ bug, now that there appear to be 2 ways of
achieving the same thing.


I think Gabriel has some good points on why the GObject syntax can be
better. On the other hand, aside from my concern above, this syntax is
not what's used in examples, which may hinder patch writers.

I believe we should either stick with what we've got, or start writing
all new code the way Gabriel has. Currently, I'm leaning towards
sticking with what we've got because more people are familiar with it.

Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://pidgin.im/pipermail/devel/attachments/20070520/128064da/attachment.sig>


More information about the Devel mailing list