Vault Tec   All about the Kinder™
I am the CEO/Co-founder of E29 Incorporated. I've been in the software industry for ten years now, have experience in about ten different computer languages, and once wrote a 60,000 line web application in three months without caffeine. I really wouldn't want to do that again.
Read more about me here, stalker.
 

WTF - PHP to use backslash as namespace separator

Are you serious?

It apparently was confirmed on Saturday that PHP’s namespace separator will be a backslash.

Not only does this fly in the face of every coding standard ( and established language ), it’s idiotic. Why not adopt the Java import standard? Instead of something akin to:

require "PDO/mysql.php";

$object = PDO\Mysql("arg");

You would have:

require php.pdo.mysql;

$object = Mysql("arg");

For runtime or static namespacing, you could just use the full namespace:

$object = php.pdo.mysql("arg");

But no, after a “lengthy” IRC discussion, they’ve decided to subject us to this:

$object = Some\stupidly\long\name\space("hi");

One concern with using something like :: or -> is that it was used elsewhere, and \ wasn’t. Oh wait, except for escaping something.

Honestly, after using Python and Java more, I’m rarely even use PHP. Namespaces was something that would have brought me back to the fold, but I’m not interested in using the retarded backslash separator. After nine years of programming in PHP, I think I’m ready to hang up the hat and move on to something better, faster, and more standard.

Tags: ,

5 Comments

  1. Jeremy Privett on 27.10.2008 at 14:02 (Reply)

    I agree. This is easily the stupidest thing I’ve seen come out of the PHP developers in a long fucking time.

  2. Philippe LACHAISE on 27.10.2008 at 14:29 (Reply)

    One first awful design decision was forgivable : dot as string concatenation operator.

    For the backslash thing, I had to double-check on a calendar : believe it or not, it’s NOT an April’s fool joke !

  3. Calvin on 28.10.2008 at 20:35 (Reply)

    They should have went with the smiley face. At least then while you’re writing code, something is smiling back at you instead of the idiotic backslash.

  4. Faltzer on 02.01.2009 at 10:37 (Reply)

    Namespaces in PHP? Don’t you mean classes?

    1. Adam Kinder on 02.01.2009 at 18:49 (Reply)

      mmm no, PHP6.. or is PHP5.3? will have namespace support.

Leave a comment