[Gtk-sharp-list] Atk interface and Gnome.App names

Mike Kestner mkestner@ximian.com
Wed, 07 Apr 2004 23:15:05 -0500

On Wed, 2004-04-07 at 12:22, Samuel Kaufman wrote:

> It's a matter of opinion, I suppose.  IMHO, one of the advantages of
> using bindings is that you get an API that seems to be native to the
> language.  Naming of classes is part of the that..

We also get easier access to all the resources of the gtk+ world if we
stay as consistent with their nomenclature as possible.  Yes, we want to
have fully cooked documentation, and hopefully we'll get there sometime
soon.  However, there's an obscene amount of code out there in C using
the Gtk+ API.  The closer our API is to the C API, the less thought it
takes to "reuse" ideas from those codebases.

There is also a large base of Gtk+ hackers out there.  When you show up
on #gtk+ or #gnome on irc and you ask "How do I use Gnome.AppWindow?"
people aren't necessarily going to be sure that you are really talking
about GnomeApp.

So, the general policy is to keep the amount of name mangling to the
bare minimum it takes to get it to compile and expose the nice syntactic
sugar of C#.  For this reason, it is highly unlikely I'll ever accept a
patch to change Gnome.App to Gnome.AppWindow.  The potential losses in
doing so outweigh the gain.

> GLib.IWrapper exists, as well.  Interfaces seem scarce in the Gtk# API. 
> I'd be more than happy to file a report and write a patch for the
> generator if that's what we want.

IWrapper is also a hand-coded interface.  The generator does not
currently prepend the magic "I" to any generated interfaces.  It is at
most a 10 minute hack to do so.  Basically it's "change a WriteLine in
InterfaceGen" and "change a WriteLine in ObjectGen."  I could've
probably done it in less time than it took to type that sentence.  

The question is whether there's any real value in doing so.  There is no
way to "implement" a GInterface in a subclass right now.  I think the
"I" is a reasonable convention in new code, but I'm not sure how much
more readable it really makes code.  I'm not opposed to such a change
though, since the likelihood of confusion over the inconsistency of a
prepended "I" is probably small. If someone wants to submit a patch for
review, knock yourself out.

Mike Kestner <mkestner@ximian.com>