Re: Re: [PEPr] Call for votes on Web Services::Services_GeoNames

From: Date: Wed, 10 Dec 2008 20:52:19 +0000
Subject: Re: Re: [PEPr] Call for votes on Web Services::Services_GeoNames
References: 1 2 3 4 5 6 7 8  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-51276@lists.php.net to get a copy of this message
Michael Gauthier a écrit :
On Wed, 2008-12-10 at 19:42 +0100, Christian Weiske wrote:
Hello David,
That's said if there's some conscensus about exceptions codes constants naming, I'll be ok to change their names, the package being beta there will be bo BC worries.
I'd like to have status of PEAR QA about this *class constants* usage but consider already that you've my vote +1
Chuck pointed me to the actual specs for constants that recommends prefixing them with the name of the package to uppercase: http://pear.php.net/manual/en/standards.naming.php I think this does not make sense for class constants (it's quite redundant to type Services_GeoNames::SERVICES_GEONAMES_SOME_CONSTANT). I'd just remove the "E_" prefix.
In Crypt_GPG [1], I use Crypt_GPG::ERROR_FOO. That said, I also have a few different sets of constants in the same file, so some form of namespacing (besides classname) is required.
I don't think we should set strong coding standards for class constants, stating something like "class constants should try to be as meaningful as possible, separated by underscores for readability and uppercased" is enough imho. -- David

« previous php.pear.dev (#51276) next »