Request for Comments: Namespace Separators
- Version: 1.0
- Date: 2008-10-25
- Author: Lukas Smith smith@pooteeweet.org
- Status: Implemented in PHP 5.3 (with
\
separator) - First Published at: http://wiki.php.net/rfc/namespaceseparator
This RFC is the result of a discussion on IRC with Greg, Dmitry, Steph, Derick, Elizabeth, Johannes, Andrei, Scott, Hannes and myself.
Introduction
The purpose of this RFC is to decide on a namespace separator
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
Rating
- +1 means the separator is not affected negatively by the criteria
- +-0 means that the separator is only moderately affected by the criteria
- -1 means the criteria is severely affected by the criteria
critieria | \ | ** | ^^ | %% | :> | :) | ::: |
---|---|---|---|---|---|---|---|
type-ability | +-0 | +-0 | -1 | -1 | +-0 | +-0 | +-0 |
typo-vulnerability | +1 | -1 | -1 | -1 | -1 | -1 | -1 |
parse-ability | +-0 | +-0 | +-0 | +-0 | -1 | -1 | -1 |
IDE compatibility | +1 | +1 | +1 | +1 | -1 | -1 | +1 |
number of chars | +1 | -1 | -1 | -1 | -1 | -1 | -1 |
Please note that we did not weigh all criterions evenly. Also we only included choices that we still felt relevant. For example as you can see in the IRC logs at the bottom we had already ruled out “::”.
As such we have decided to go with
\
as the new namespace separator instead of the current
::
References
- IRC discussion that illustrates how we got to the decision of going with a new separator and how we came up with the criteria and the ratings.
- previous namespace RFCs: