Re: Fw: [php-gtk-cvs] cvs: php-gtk / CODING_STANDARDS

From: Date: Thu, 27 Oct 2005 06:13:27 +0000
Subject: Re: Fw: [php-gtk-cvs] cvs: php-gtk / CODING_STANDARDS
References: 1 2 3  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-1964@lists.php.net to get a copy of this message
We have PHP5, so we should use it, IMHO. There is no reason to be backwards compatible as the same code wouldn't run in PHP4 anyway. If your writing a class and have constants related to the class, then they belong inside the class. If instead your making a constant which isn't related to a class, then global constants are fine. To word another way no MYCLASS_* only MyClass::* but BLAHBLAHBLAH is allowed. -Jeremy On 10/26/05, Steph Fox <steph@zend.com> wrote: > > That's consistent with PHP-GTK 2's approach to GTK+, but not to PHP... > > Anyone else have any strong feelings about this (hands up - I don't). > > - Steph > > ----- Original Message ----- > From: "Scott Mattocks" <scott@crisscott.com> > To: "PHP-GTK dev" <php-gtk-dev@lists.php.net> > Sent: Wednesday, October 26, 2005 4:59 PM > Subject: Re: [PHP-GTK-DEV] Fw: [php-gtk-cvs] cvs: php-gtk / > CODING_STANDARDS > > > > The only thing that I would change is the part about user defined global > > constants: > > > > For other constants in the global namespace (that is, constants in > > your PHP code), stay with the PEAR format: MYCLASS_CONSTANT_NAME. > > > > The PEAR CS has to be backward compatible for PHP 4. That is why they > > require MYCLASS_*. Since we don't have to worry about PHP 4 any more, I > > think we should divert from PEAR a little here. Consistency would be > > better in my opinion. How about this: > > > > User defined classes should not declare constants in the global > > namespace. All user defined classes should declare constants in the > > class namespace. For example: MyClass::SOME_CONSTANT instead of > > MYCLASS_SOME_CONSTANT. > > > > Scott > > > > Steph Fox wrote: > > > OK guys, tear it apart :) > > > > > > ----- Original Message ----- > > > From: "Steph Fox" <sfox@php.net> > > > To: <php-gtk-cvs@lists.php.net> > > > Sent: Wednesday, October 26, 2005 2:14 PM > > > Subject: [php-gtk-cvs] cvs: php-gtk / CODING_STANDARDS > > > > > > > > >> sfox Wed Oct 26 09:14:32 2005 EDT > > >> > > >> Added files: > > >> /php-gtk CODING_STANDARDS > > >> Log: > > >> Initial commit of coding standards file. > > >> > > >> > > >> -- > > >> PHP-GTK CVS Mailing List (http://gtk.php.net/) > > >> To unsubscribe, visit: > > >> http://www.php.net/unsub.php > > >> > > > > > > > -- > > Scott Mattocks > > scott@crisscott.com > > http://www.crisscott.com > > http://pear.php.net/user/scottmattocks > > > > -- > > PHP-GTK Development Mailing List (http://gtk.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > PHP-GTK Development Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- --------------------------- Jeremy Johnstone http://www.jeremyjohnstone.com jsjohnst@php.net

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