On Fri, Feb 17, 2012 at 05:56:19PM +0200, Zeeshan Ali (Khattak) wrote: > On Fri, Feb 17, 2012 at 5:38 PM, Christophe Fergeau <cfergeau@xxxxxxxxxx> wrote: > > This naming convention for getters is probably only useful for vala, I > > think bindings for dynamic languages will introspect object properties at > > runtime and use g_object_get(). > > Well, vala will also do the same but setting properties through that > is known to be considerably slower than using the getter/setter > directly (because of the type checks etc invovled in case of > g_object_get). Yes, and I'm not saying we should go this way. > > >So the decision to make is between making > > the API nicer to read for C users VS making life slightly easier for some > > bindings. > > That is not the decision at all for me since I don't see anyone other > than you complaining about the various gtk+ APIs following this > convention. If you can cite examples of C developers complaining about > it, that would be convincing argument to me. This is such a small annoyance that noone will complain only about it, but the difference between an okayish API and a great API to use lies in all these small details. I'm quite sure I've seen people making fun of _get_has_xxx though. And you also agreed that _is_ was better than _get_ in that email link I gave: "I admit that sounds better", so it's not just me (and I think most people would say _is_xxx is better, and not many people would answer upfront "oh, all g* APIs use get_xxx so you should use this"). > > Would a Rename to: annotation help vala here? Or is there some annotation I > > don't know of to mark property getters/setters? > > Maybe? But I don't think we are that desperate yet. :) Why? You are the one insisting that the vala bindings are as efficient as possible, it would be nice to know exactly what options we have. Christophe
Attachment:
pgpioQkmD3hfq.pgp
Description: PGP signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list