Hi Nate,

Only if you insist on *not* using the namespaces to solve collision
problems. For the 1001th time - you can not expect to put all names into
global space and have the language by some magic to sort it out and go
both ways. One name can mean only one thing, namespaces or not.
Namespaces just allow you more convenient rules for defining what name
means what thing.

I would like to second this notion.  There are those who would say
that the global namespace is for the use of PHP itself.  I would
disagree heartily, PHP as a language is built to serve the developer
who is using it.  They should decide what exists in the global
namespace.

I'm firmly in the 'global namespace is for the use of PHP itself' camp. Why? Because it gives users the choice of totally ignoring namespace support if they don't want to use it, and because allowing user code to define classnames and functions in the global space via import/use (as opposed to by default) has a huge potential for difficult-to-debug misuse. If people want to be able to alias stuff they should be forced to namespace their code.

When I write a library I will often create functions/classes/variables
that have no business being used outside my library.  So I don't see
the need to make the names longer just so I don't collide with someone
else's internal variables/classes/functions.

Fine, so namespace it.

- Steph
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to