note 82969 deleted from language.namespaces.definition by philip
| From: | philip@php.net | Date: | Fri, 28 Nov 2008 18:54:17 +0000 |
| Subject: | note 82969 deleted from language.namespaces.definition by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-147107@lists.php.net to get a copy of this message | ||
Note Submitter: Valeriu Palo
----
I see nothing wrong with this implementation.
Having free code disallowed in namespaces is (I think) a good thing. If namespaces are used in a
script, it is quite clear that the script is strongly object oriented, and thus the usage of
variables and code that are "raw" in a namespace is nothing less than weird! That
functionlity would much better fit inside a class (or a Singleton?). It is the same principle behind
what makes global variables a bad choice.
As far as the naming conventions go, a namespace is only meant to help you "isolate" your
constructs from what others might accidentally create and then clash with your scripts. Of course
one could potentially use the same identifiers as another but the point is that such an act would be
intentional and not accidental! When you create a library, you might want to put everything inside a
namespace that is intuitively connected to you or your project and not something that someone else
might be inclined to use.
Alas, this truly has NOTHING to do with the language!