note 81417 added to language.namespaces.definition
| From: | RS at osu1 dot php dot net | Date: | Wed, 27 Feb 2008 10:31:51 +0000 |
| Subject: | note 81417 added to language.namespaces.definition | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136524@lists.php.net to get a copy of this message | ||
I don't see how this implementation of namespaces gives you anything you didn't already
have.
Let's say someone is writing a set of classes to handle gizmos... most developers would write
something like:
<?php
class GizmoBird() {
}
class GizmoPlane() {
}
?>
Now with namespaces, this would look like:
<?php
namespace Gizmo;
class Bird() {
}
class Plane() {
}
?>
But this doesn't really help you isolate your classes any better. someone else could still
write another set of classes with the same namespace, and Gizmo::Bird would clash with another
developer's Gizmo::Bird, in the exact same way that GizmoBird would clash with another
developer's GizmoBird.
So effectively, all you've done is add a couple of colons to the classnames...
I honestly hope developers in general don't start using this...
----
Server IP: 87.54.44.10
Probable Submitter: 82.143.224.4
----
Manual Page -- http://www.php.net/manual/en/language.namespaces.definition.php
Edit -- https://master.php.net/note/edit/81417
Del: integrated -- https://master.php.net/note/delete/81417/integrated
Del: useless -- https://master.php.net/note/delete/81417/useless
Del: bad code -- https://master.php.net/note/delete/81417/bad+code
Del: spam -- https://master.php.net/note/delete/81417/spam
Del: non-english -- https://master.php.net/note/delete/81417/non-english
Del: in docs -- https://master.php.net/note/delete/81417/in+docs
Del: other reasons-- https://master.php.net/note/delete/81417
Reject -- https://master.php.net/note/reject/81417
Search -- https://master.php.net/manage/user-notes.php