• Archives

  • Categories

Oct 26

PHP to use backslash as namespace separator

PHP is going to have backslashes for namespace separator.

Thx to the initiative of Scott and Steph we had an IRC discussion with several code developers. The result is that we have decided to go with backslash as new separator for namespaces.

As the patch is still under development it is yet unclear how this will affect the scheduling PHP 5.3. (Source: PHP internals)

Criterions

  • (1) type-ability (how easy is it to type the separator)
  • (2) typo-vulnerability (how easy is it to make a typo and get an unwanted behavior without a error/warning)
  • (3) parse-ability (how easy is it to read the code and figure out whats going on without getting confused with similar syntax that means another thing)
  • (4) IDE compatibility
  • (5) number of chars

Ratings

  1. +1 means the separator is not affected negatively by the criteria
  2. +-0 means that the separator is only moderately affected by the criteria
  3. -1 means the criteria is severely affected by the criteria
critieria
\
**
^^
%%
:>
:)
:::
(1)+-0+-0-1-1+-0+-0+-0
(2)+1-1-1-1-1-1-1
(3)+-0+-0+-0+-0-1-1-1
(4)+1+1+1+1-1-1+1
(5)+1-1-1-1-1-1-1

(Excerpt from PHP RFC)

I would much prefer the :> smiley but I would suppose the other developers not having as much favor to that. Backslashes are okay I guess. I am more used to periods though.

backslash\backslash\backslash\kaboom.

Possibly related:

  1. PHP: I didn’t expect that Paamayim Nekudotayim!
  2. It’d be pretty funny to code in Chinese
  3. How to do a parseInt in…
  4. Salary of programmers by programming languages

“PHP to use backslash as namespace separator”
one comment

  1. This is really troublesome… backslashes are typable only on QWERTY keyboards… PHP Devs do not like NON-English people ? ;-)

    I’m really not interested in modifying my code to follow those rules…

    Apr 20

Leave your comment.


WordPress powered and Django inspired.
Love and elephants come after.
RSS: Posts and comments.