Ruby is yet another scripting language that claims all the usual things such as being easier to use, fully object oriented etc. It is the brainchild of Yukihiro Matsumoto. If you feel you want to try your hand at learning it, this is about the best of the books currently around. The author writes fluent English that is a pleasure to read. However he walked right into a mess when he decided to make the first program in the book a little more complicated than the standard 'Hello World." This program is to convert between Centigrade and Fahrenheit temperature scales. Being a careful reviewer when dealing with things that are new to me I surfed over to www.ruby-lang.org. There I found a range of different versions of Ruby. I selected the one that would seem to give me the least problem as it was a complete install (1.6.6 for Windows if you want to know) installed it and typed in the half page program.
Now the first irritant was that the editor seemed to want to control the indent for each line. No problem except that it did not match that in the book. Now when I had it all typed in I used the hotkey to run it. I was faced with an unhelpful statement that I had a syntax error. No hint as to where or what. I did a sort of binary chop to remove increasing amount of the program until I eventually determined that the problem was somewhere in the line that validated the input was convertible to a numeric value. However there I ground to a halt. Despite trying every variation I could think of I could not get that line accepted. In the end I threw away the validation and ran the rest. However this is not the kind of experience that anyone should have first time out with a new language. And note that it was only my experience in crude debugging techniques that brought me any kind of success.
It is hard to separate reviewing this book from reviewing the language. If you are reading this on the web please remember that these reviews are written by and for members of ACCU rather than aimed at the wider public. The problem I have with Ruby is that it is sensitive to details that other languages would simply ignore. Let me give you an example, one of the following four expressions evaluates differently form the other three:
x = y+z
x = y + z
x = y +z
x = y+ z
Which (it is actually the third) and why actually matters very little, I think that degree of dependency on whitespace is unhelpful. There are other things I like such as the rules about names that clearly distinguish global, local, instance and class variables. It is another way of meeting my wish that programme editors for C++ would colour those differently scoped names differently (I rather like having global variables in bright red and namespace ones some shade of pink) but if I understand what I have read, the naming rules for Ruby are provided by the language. Like several other scripting languages, names are untyped.
I have no doubt that if you want to learn Ruby this book is a good place to start (but it would be to your advantage to be an experienced programmer first). My doubts are more as to whether you should invest time in learning this language. Perhaps I am biased, but I would opt for Python as my scripting language of choice.