Posts tagged with ‘syntax’

 

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.

 

Saw this at cactusbeetroot’s blog:

x = 0;
油 = 0;

如果 (x 是真的)
{
油++;
x = 假;
}

You can see that the code is trying to 加油. Haha! But there really exist Chinese programming languages. (more…)

 

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