note 82969 added to language.namespaces.definition
| From: | ValeriuPalo at osu1 dot php dot net | Date: | Sun, 04 May 2008 05:57:33 +0000 |
| Subject: | note 82969 added to language.namespaces.definition | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139045@lists.php.net to get a copy of this message | ||
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!
----
Server IP: 69.147.83.197
Probable Submitter: 81.181.209.118
----
Manual Page -- http://www.php.net/manual/en/language.namespaces.definition.php
Edit -- https://master.php.net/note/edit/82969
Del: integrated -- https://master.php.net/note/delete/82969/integrated
Del: useless -- https://master.php.net/note/delete/82969/useless
Del: bad code -- https://master.php.net/note/delete/82969/bad+code
Del: spam -- https://master.php.net/note/delete/82969/spam
Del: non-english -- https://master.php.net/note/delete/82969/non-english
Del: in docs -- https://master.php.net/note/delete/82969/in+docs
Del: other reasons-- https://master.php.net/note/delete/82969
Reject -- https://master.php.net/note/reject/82969
Search -- https://master.php.net/manage/user-notes.php