Re: Enums, flags and ::

From: Date: Tue, 25 Oct 2005 20:31:06 +0000
Subject: Re: Enums, flags and ::
References: 1 2 3 4 5  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-1953@lists.php.net to get a copy of this message
Andrei Zmievski wrote:
On Oct 25, 2005, at 1:04 PM, Steph Fox wrote:
What's the deal about global scope? OK there could be namespace collisions - but on the other hand those are GTK+ constants, easily recognisable and AFAIK used everywhere that uses GTK+. It'd have to be a very 'newbie' error to name a local constant GTK_*, given that scenario.
What about GDK_*? PANGO_*? ATK_*? GLADE_*? SOMEOTHEREXTENSION_*? How will this look when all the extensions register their constants globally?
Personally, I like having everything separated out by extension. I think Gtk::SOME_CONSTANT is cleaner than GTK_SOME_CONSTANT. (Please note my not so subtle vote for Gtk as opposed to GTK) I don't think that sticking with Gtk+ style is a valid argument. By that argument we should have the same function calls to. I don't think anyone wants to have gtk_tree_view_get_selection() instead of $treeView->get_selection(). I don't think the scope of a constant matters much to the end user. No matter what scope a constant is in, it should behave the same. I think this needs to be addressed from a PHP-GTK programmer's readability point of view and I just think that Gtk:: is easier to read and follow than GTK_. Scott

« previous php.gtk.dev (#1953) next »