It's a design decision that works well for me too. I don't see it as a
particular waste, considering that there are other wastes I'd like to
get rid of. PHP is a maturing language and there is (imho) still a lot
of ground to cover.

BTW, it's not a matter of "questioning"... as far as I'm concerned it'a
matter of "considering" what the consequences of any change that is made
to the software are. Consider the amount of damage that turning
register_globals off has made--all you have to do is counting the
e-mails the list gets every day; I counted up to ten in a day--and
you'll see that changing the dollar sign convention, a much more
pervasive convention, can be a disaster.

php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers

Come visit us at!
--- Begin Message ---
>     That's the way the language designers did it, and there's LOTS of
> PRODUCTION code out
> there that uses it.
>     See also the precedence of PERL.

Well, perl and PHP use the $ for slightly different reasons, it seems.
In perl, the *thing* in front of a variable name ($, @, %) indicates
what context the variable is being used in (scalar, list, hash).
Depending on what you want your variable to do, using a different
character makes all the difference.  The leading character is not a part
of the variable name.

PHP seems to use the $ more for readability, and possibly for making the
language easier to parse (and, of course, the aforementioned
string-embedding).  Since all variable types (scalars, arrays, objects)
seem to use the $, it seems more for syntactic uses and less as
something that changes how the object behaves.

However, I like having it there.  It (as someone else mentioned) helps
me quickly see where variables are used, both in and out of strings.  It
also probably helps syntax-highlighting text editors read the code more
quickly, although it may be just as easy without.

All I know is when I think back to programming C++, I can't imagine how
I could deal with variables that didn't have something in front of them
to separate them from barewords.

Oh well.

[ joel boonstra | [EMAIL PROTECTED] ]

PHP General Mailing List (
To unsubscribe, visit:

--- End Message ---
PHP General Mailing List (
To unsubscribe, visit:

Reply via email to