Slashdot Mirror


PHP Gets Namespace Separators, With a Twist

jeevesbond writes "PHP is finally getting support for namespaces. However, after a couple hours of conversation, the developers picked '\' as the separator, instead of the more popular '::'. Fredrik Holmström points out some problems with this approach. The criteria for selection were ease of typing and parsing, how hard it was to make a typo, IDE compatibility, and the number of characters."

2 of 523 comments (clear)

  1. Re:Going back to DOS style... by Dogtanian · · Score: 0, Troll

    Going back to DOS style...

    No; DOS used the backslash as a directory separator (since- apparently- someone had permitted forward slash to be a legal filename character before subdirectories had been introduced).

    AFAIK PHP uses the forward slash for that purpose (or does this depend upon the server/OS it's running under?) Either way, namespaces have nothing to do with the infamous DOS usage.

    --
    "Slashdot - News and Chat Sites Deviant". (Click "homepage" link above for details).
  2. And Python is better? by Anonymous Coward · · Score: 0, Troll

    OK, yes Python is better than PHP but they're both a pain in the ass for the web/text based world of web development. I mean really, both PHP and Python are not that much easier to use than just writing a program in C/C++. Things like regular expressions are stupidly annoying to use (compare to Perl or Lua+LPeg). I don't even get the point of Python because it's a slow scripting language with almost all the verbose complexity of a compiled language. Just weird.

    Unfortunately there aren't a lot of options. Perl isn't all that great because while it's awesome at the usability and text processing part it's not so good from a structured design point of view. It's difficult to design complicated software in Perl. Plus Perl is basically dead since they decided to start that idiotic Perl 6 project that will never be finished (and even if it is I'm sure it will suck).

    My personal choice would be something like Lua with LPeg and a nice large supporting library. I know the Kepler project does work in this space but their stuff isn't anywhere near as nice as what is available in PHP and Perl API's. Their designs are just odd because they approach things from a Lua point of view instead of a web developer point of view.