Stanislav Malyshev wrote:
Well this is very common with PHP, it's very flexible and it's easy for
a bad programmer to create chaotic code and get away with it, but this
can happen with many features of PHP. For serious developers however,
Right. This is why I don't think it's a good idea to add one more
feature with very high potential for abuse. Code that changes
behaviour of unrelated other code is usually very bad idea - think
about what happens if some of your functions somewhere among 10K lines
of code used $cfg as local variable and then you added $cfg as
superglobal.
them. No point in holding stuff back from people who could benefit from
it just to protect inexperienced them from their own sloppiness. You
know what I mean?
Yes, there is a point in not implementing features that would promote
bad coding and unnecessary surprises for the users. Especially when
the same function can be achieved with existing functionality in a
much better way.
This assumes there is never a good reason for a super global which makes
me wonder why PHP has super globals at all then? What if, because I use
it so often and want to differentiate it, it just works better for me to
make it a super global? I could always name it with the standard $_
naming scheme so as to not run into accidental use. I don't often use
globals but when I do it's usually because it's something I'll use a
lot. It doesn't benefit code readability to have the same thing repeated
hundreds of times. It's not a big issue but I do like the idea of making
super globals easy to do.
All this forcefulness of writing pristine code from the people that
teach people that it's okay to inline their HTML, Javascript, CSS, SQL,
and who knows what else into their PHP? Talk about a recipe for
disaster. Oh well, at least you didn't refuse to add a switch statement
like Python.
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php