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: ,

May 03, 2007

Not yet on Rails

I have not yet stood on Rails to balance myself. I am just starting to know the building blocks. Before I can stand on the Rails, I have to learn Ruby and that's definitely the step one towards learning Ruby on Rails. It all started when I decided to develop a web based application. Not for a client, but for my personal creativity. At first I chose PHP to develop the web based application and that led me to read books on PHP. I have already worked on Perl for sometime. But that was like years ago and I know Perl has gone many changes after that. But still I always felt that Perl seemed kind of a geeky language or a language that is very similar to shell scripts. Being a Java developer, I always appreciated a programming language that is not geeky looking. When I say geeky looking I meant not having all those "$" characters appearing everywhere. Also Perl was not based on OOP. So I decided to try PHP. After reading books on PHP, I felt that I am getting dragged into the geeky world of programming again. The appearance of "$" sign everywhere and the non-OOP of PHP was not getting my favor that much. Thought PHP 5.x has OOP, but the lack of namespace was a complete turn-off. I know I would be using a scripting language, but I didn't want a language that would make me write more code to achieve something. It's not how fast I can write, it's about how much I can maintain later. Then I stumbled upon Ruby. To be honest, it looked funky at the beginning. A programming language that reads like English? A programming language that has poetry mode? Interesting things to notice and also got my curiosity. So I read a little bit and found Ruby more interesting. Yes, they have more "@" than "$" sign. But the complete OOP and the namespace etc. made it more worth trying than PHP. So I ordered the book The Ruby Way by Hal Fulton. I read the first 50 pages and realized that this would be the second book to read. I need to read Programming Ruby first and then come back to this book. The book is on order and once it reaches my desk I would read it. I will post my feedback in the subsequent post. Until then the balancing is not happening!

Labels: , ,