Re: What are the problems PEAR2 seeks to solve? [and a solution to therequire_once debacle]
| From: | Philippe Jausions | Date: | Wed, 29 Aug 2007 14:16:58 +0000 |
| Subject: | Re: What are the problems PEAR2 seeks to solve? [and a solution to therequire_once debacle] | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-47895@lists.php.net to get a copy of this message | ||
Alexey Borzov wrote:
> Hi,
>
> Philippe Jausions wrote:
>> Just a quick note: I'd strongly suggest to not shortcut the namespaces
>> or even use import at all in PEAR2, but always use fully qualified
>> namespaces. It makes the code much clearer for debugging, and prevents
>> WTF moments.
> For me the most obvious benefit of namespaces is getting rid of
> PEAR2_Obnoxiously_Long_Class_Names
> (HTML_QuickForm2_Element_Select_OptionContainer, add PEAR2 to the
> front and you get the idea). Your suggestion kinda defeats this benefit.
I agree that long names are a PITA, and that with namespace they would
even get longer, :: vs _ . But I feel that spelling things out
completely reduces the need to track down whatever namespace a class
might belong to.
IMO the namespace are great to allow you to name your classes whatever
you like without worrying about collision with others' code, PHP base
code included.
Call me paranoid if you will, but bugs in implementation of namespaces
in PHP are always possible and I do not wish to get bug reports from
users that start doing a bunch of "imports" and suddenly nothing works
anymore or copying/pasting snippets of "conveniently-simplified" code
and asking what's wrong.
Anyway, we're not even there yet There will be ample time to define a
coding standard regarding namespaces when we can play with them in PHP.
My $.02
-Philippe