Re: PHP global namespace clogged up

From: Chris Hope (blackhole_at_electrictoolbox.com)
Date: 09/03/04


Date: Fri, 03 Sep 2004 13:13:01 +1200

Tim Tyler wrote:

> I like PHP - but I do wish it wasn't full of such godawful embarassing
> hacks.

You do know that they rewrote the object model in PHP5, don't you? While
this doesn't address the issue of namespaces (which I wish they'd added) or
the unfortunate problem where there is little standardisation of function
naming or order of parameters, it does show that they have addressed some
of the issues with OOP.

The main problem with trying to fix PHP in respect to the issues you have
pointed out in your many posts, is that they need to maintain backward
compatibility. OK, so maybe they don't, but it makes it very hard to move
developers/hosting providers/etc onto a Brand New Version of PHP which
isn't backward compatible, even though it might address all the issues
brought about because of the way PHP has evolved. It'll take long enough
for everyone to move to v5, let alone to a new version which throws all the
existing function names and syntax out the window, and breaks all existing
legacy systems.

I like PHP because it is both procedural and object oriented. I like that it
gives me this flexibility and use a combination of both in my projects. It
would have been nice if there *were* namespaces, but I have no problem
prefixing my functions with eg foo_ to ensure they don't clash with other
function names.

-- 
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/


Relevant Pages

  • Re: PHP6 - Comments?
    ... >> For version 6, namespaces are becoming a topic again, since the sheer ... >> number of PHP projects will surely lead to name collisions. ... namespace collision is not a problem PHP ... > programmers' tendency to write rubbish documentation. ...
    (comp.lang.php)
  • Re: [PHP] Architecture patterns in PHP
    ... 316 Query SHOW TABLES FROM `cake` ... 316 Query DESCRIBE `posts` ... Application and Templating Framework for PHP ... when they cache the results of reverse engineer the object model from ...
    (php.general)
  • Re: PHP6 - Comments?
    ... > For version 6, namespaces are becoming a topic again, since the sheer ... > number of PHP projects will surely lead to name collisions. ... required for that request, so how many times would you want to link to TWO ... Multiple inheritance does not exist in Java, so why should it exist in PHP? ...
    (comp.lang.php)
  • Re: [PHP] circular dependency between libraries
    ... problems and leave you with only the 'slightly' inelegant situation where you ... have to, internally, sync the 2 codebases now and again. ... If PHP had namespaces, I'd be happy. ...
    (php.general)
  • Re: [PHP] for the sake of conversation - syntax
    ... How does PHP work out where these "packages" are? ... The ability to have multiple namespaces per file leads to issues with the "as" or "into" syntax. ... private DbHandlerB $dbb = new DbHandlerB; ... One would hope that when namespaces are ubiquitous there will be no need to prefix functions with package identifiers. ...
    (php.general)