Re: [PEPr] Comment on RFC::Prefix all packages with P_
| From: | Bertrand Mansion | Date: | Thu, 13 Jul 2006 15:39:39 +0000 |
| Subject: | Re: [PEPr] Comment on RFC::Prefix all packages with P_ | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-43467@lists.php.net to get a copy of this message | ||
Ilia Alshanetsky wrote:
>
>Ilia Alshanetsky (http://pear.php.net/user/iliaa) has commented on the proposal
>for RFC::Prefix all packages with P_.
>
>Comment:
>
>In the best case scenario if PHP 6 were to be released this year as stable
>it would take many years before it would take any market share. I mean PHP
>5 has been out for over a year and is barely at 10% adoption and BC changes
>between it and 4 are relatively minor compared to what PHP 6 will
>introduce.
That's certainly one of the reasons why people don't use PHP5.
>This means for the next couple of years you need to plan on
>PHP4/PHP5 based code and cannot rely on namespaces which may not even be
>part of PHP 6.
>
>Furthermore, taking up of common names by PEAR classes is a problem
>waiting to happen as exemplified by "date" class and in the future needs
>of the language (PHP) will always trump needs of outlaying
>classes/libraries. This means that if the names are not changed, don't be
>surprised to see same names used by PHP itself causing conflicts for
>users/developers of affected classes.
I agree. Objective-C, another "no-namespace" language suggests that you prefix
your classes with 2-3 letters [1]. For example, the Cocoa framework inherited
from NextStep has all its classes prefixed with NS. The difference with PHP is
that this problem was addressed from the beginning.
Well, better late than never. The P prefix for PEAR sounds good but the prefix
chosen doesn't matter as long as there is a prefix. PHP language classes should
get a prefix too otherwise the rule is broken.
There could also be a simple loader class in PEAR that would take care of
name/path translations...
For people who need namespaces today, there are other languages like Ruby or
Python which do the job quite well.
[1]
<http://developer.apple.com/documentation/Cocoa/Conceptual/CodingGuidelines/
Articles/NamingBasics.html#//apple_ref/doc/uid/20001281-1002226>
--
Bertrand Mansion
http://www.mamasam.com - creative internet solutions
http://golgote.freeflux.net - blog