Escape from Namespaces

I admit that I am an unproductive whiner on this issue. I don’t care if namespaces go into PHP or not; at this point, I’d almost rather they not. But some of my feelings as expressed on IM this morning:


09:13:08  pmjones: yayfornewnamespaceseparator
09:13:12  pmjones: hmmmm
09:13:19  nate: oh geez
09:13:27  nate: I can't believe they picked *that* one
09:13:33  pmjones: does that mean there are two newlines in that phrase?
09:13:36  pmjones: who knows.
09:13:53  nate: you should really post something like that
09:14:01  pmjones: maybe PHP really *is* getting bought by Microsoft
09:14:12  nate: yeah
09:14:17  nate: you'd have at least thought they'd go with /
09:14:31  pmjones: no, that's division
09:14:38  pmjones: which might make sense, now that i think about it
09:14:47  pmjones: for all the divisiveness we have over it
09:14:51  nate: heh ;-)
09:14:59  nate: you took the words out of my mouth
09:15:03  nate: er, fingers
09:15:06  pmjones: indeed
09:15:16  pmjones: i know you want namespaces very badly ...
09:15:23  pmjones: ... but do you want them *this* badly?
09:15:45  nate: still undecided
09:16:00  pmjones: if you want them badly, badly is what you've got ;-)

To explain the jokes:

The “n” characters in the namespace string are escaped newlines; thus, “yayfornewnamespaceseparator” might well be translated as “yayfor[newline]ew[newline]amespaceseparator”. ASCII gurus will know what f and s translate to.

Zend Is Not PHP, so Microsoft can’t buy “PHP”. But the backslashes are very DOS-ish.

Here ends the unproductive whining, at least for now.

Are you stuck with a legacy PHP application? You should buy my book because it gives you a step-by-step guide to improving your codebase, all while keeping it running the whole time.

15 thoughts on “Escape from Namespaces

  1. Ninh summed it up quite nicely πŸ™‚
    http://ninh.nl/blog/2008/10/25/a-word-on-phps-upcoming-namespace-seperator/

    “As mentioned before, C++ also uses the β€œ::” as a means to denote a namespace separator. Like PHP (or actually, the other way around), it also uses the β€œ::” for static class member access. So doesn’t C++ have to deal with the same problem then?

    The answer to this question is no. Even though in a similar situation, it is also bound to suffer from the same ambiguity problem, the compiler will just simply tell the programmer that that particular symbol has already been defined.”

  2. I’d like to have πŸ˜€ as separator, because it’d really fit my happiness when working with Solar. Think on “Solar πŸ˜€ Sql”: it’d be perfect!!!

    hmmm, ok, i’ll be quiet now.

  3. is indeed bad.

    But people suggesting using Python where white space is significant.. is far far worse, imo.

  4. The (escape) character is only an escape character when it’s in a string, I’ve not looked but the namespace declaration is probably not surrounded in quotes. Personally I cannot wait for namespaces all this My_Package_Is_Called_This_SoThere is doing my head in.

  5. Yes…

    The whitespace in Python is a killer for me too, far too much hassle for me to use it over PHP.

    But just what are we going to do about this namespace separator? The backslash is complete and utter horse manure, and the individual responsible needs to hang their head in shame.

    Bring back :: as that is more suitable to PHP and would someone please tell Microsoft where to go?

Leave a Reply

Your email address will not be published. Required fields are marked *