Ilia Alshanetsky wrote:
There are no "rules" there is just one rule, that's not even specific to
PHP when you think of it. It is generally considered to be a good
practice to prefix your code with app name or similar to avoid conflicts
with other libraries and/or applications. When it comes to this rule, I
think it is one of the very few that are essential for developers to learn.
What about "do not trust user input"? Or "avoid copy/pasting code,
refactor instead"? Or "use descriptive identifiers"? Those are all
rules to be followed when programming. And the more there are the more
experience it takes to not get any of them wrong.
This would mean classes should be prefixed by extension name...
That is the common case, yes. In fact the date extension's classes
follow this convention to the letter. DateTime + DateTimeZone (Date
is the extension name).
Well, almost: DateTime is a date class, not a time class.
However, for native classes there maybe exceptions to simplify usage,
when a need for such exceptions arise this will be discussed on this list.
We're only talking about native classes anyway. And I think not bending
the rules simplify usage more than saving a couple of letters. Wasn't
that a lesson we learned from functions?
- Chris
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php