2007/12/5, Robert Cummings <[EMAIL PROTECTED]>:
>
> On Wed, 2007-12-05 at 09:34 -0800, Stanislav Malyshev wrote:
> > > Namespace support is for people who didn't name their
> classes/functions
> > > properly.
> >
> > Here's a claim so weird I don't know how to parse it.
>
> I think you're confusing parsing for grokking. Namespace support is
> merely candy coating for naming conventions. Namespaces have the same
> collision problems that class naming and function naming have. Only
> confined to the name of the namespace itself. This is identical to using
> a prefix when naming your classes or functions. The only thing
> namespaces bring to the table beyond that, is the ability to shorthand
> the class names within the namespace... as I said candy coating. If
> everyone had named their classes and functions with appropriate prefixes
> then this would be a non-issue. Seriously, how were so many people so
> short-sighted to think that only they would ever call a class "Date".
> There's only a few million other candidate developers out there with the
> similar ideas.


Sorry to intrude again, but that's not entirely true.

As of now, PHP namespaces may be called just sugar coating for naming
conventions, but, as I see it, they're just a first step towards a more
complete implementation of namespaces, which means more granular control
over class visibility and scope. This much enhances encapsulation on a
broader level, which is a basic need for any proper OOP supporting language.

In other words, without namespaces, we can't even start thinking about
encapsulation at package level, we'll just have all our classes publicly
available everywhere.

Reply via email to