Google Blogoscoped

Forum

PHP 6  (View post)

Marcus [PersonRank 0]

Tuesday, March 14, 2006
18 years ago

Whats wrong with the $ sign?

Corsin Camichel [PersonRank 10]

18 years ago #

Tell us another coding language that uses something like this...

Ludwik Trammer [PersonRank 10]

18 years ago #

Bash ;)

Corsin Camichel [PersonRank 10]

18 years ago #

Okay,
Tell me a REAL (no scripting) programing language that uses something like this

Philipp Lenssen [PersonRank 10]

18 years ago #

Marcus – what's wrong with it is that it's annoying to type (Shift + 4 on my keyboard), especially as you type it so often. Other languages write interpreters/ compilers that don't need it, so it's just redundant!

Ionut Alex. Chitu [PersonRank 10]

18 years ago #

From http://www.zend.com/zend/week/week171.php?article=week171&kind=wc&id=4195&open=1&anc=0&view=1

Michael Hawley suggested removing the dollar sign for variables in PHP. “The language would be less cumbersome”, he stated. He, however, saw that a “some string $foo bar” situation would require a dollar sign indeed. Andrei Zmievski noted that the decision for the dollar sign was made around nine years ago and that Michael was a little too late to bring this up. Also, an ambiguity with define()d constants would arise (Ken Tossell).

A little discussion about the various ways to output variables inside strings arose and several people expressed their favourite way of doing things. Their arguments include performance reasons. With Sterling’s note on compiler caches fixing this problem, another useless thread died. Welcome to another week of PHP development.

Corsin Camichel [PersonRank 10]

18 years ago #

To your example
Java:
System.out.print(“some string " + foo + " bar”);

ASP/VB:
“some string " & foo & " bar”

JavaScript (I know, it is scripting):
var myString = “some string " + foo + " bar”;

For Philipp:
Change to swiss keyboard layout. the $ is an own key right to [ä] [$] [ENTER]

Philipp Lenssen [PersonRank 10]

18 years ago #

They could still allow "somethig $something" for strings (but just for strings). And for downwards compatibility, they could simply allow developers to include a setting on top of programs, something like
silly_dollar_off();

Forum home

Advertisement

 
Blog  |  Forum     more >> Archive | Feed | Google's blogs | About
Advertisement

 

This site unofficially covers Google™ and more with some rights reserved. Join our forum!