Balancing On Rails

May 08, 2007

Why special characters like $, @ and @@?

This I could never understand unless somebody explains it to me. As the programming languages are advancing, we are reaching towards the human readable coding style. Then why do we have the special characters like $, @ and @@? Or is it a speciality of scripting language? However, ASP or JavaScript never use such special characters! Programming languages like C, C++ or Java or any such don't use any of these characters. Whenever I see such characters being used, I feel that I am being pushed to old age of programming or to shell scripting era! I don't see what is the advantage of using those character. Is it the shortcoming of the interpreter that can't differentiate between internal object types unless it encounters such special characters? In Ruby, I find this specifically funny. To define a class variable one has to use @@ where as to create a class method, one can use ClassName.methodName. Why can't we define class variable using ClassName.variableName? Perhaps a seasoned Ruby person can explain this to me!

Labels: ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home