Re: Re: PEAR2 Coding standards, Autoloading and Namespaces

From: Date: Sat, 05 Apr 2008 17:19:18 +0000
Subject: Re: Re: PEAR2 Coding standards, Autoloading and Namespaces
References: 1 2 3 4 5  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-49638@lists.php.net to get a copy of this message
On Apr 5, 2008, at 11:53 AM, Jeff Moore wrote:
Pro: * Code within the namespace can access the Foo class without fully specifying the class name, new Foo(). * Foo can access other classes in the same namespace without fully specifying the class name (not illustrated here). * All the files in the Foo namespace are in the same directory. * The relationship between the two classes is structurally clear for automated tools. Cons: * Exactly one class in the namespace, the namesake class, must be referenced outside of the package by the distasteful name, PEAR2::Foo::Foo.
+1 for package name -> namespace mapping. The only valid reason for not doing it is that it might be confusing to those who have never seen namespaced code. One option to remedy that is to take the approach of Java packages where everything lower case until the object. Using your example: pear2::foo::Foo That clearly delineates what is the package and what is the class while also happening to be easier on the eyes. -T

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