Advertisement
Membership
Login
ACCU Buttons
Search in Book Reviews
Search is a simple string search in either book title or book author. The full text search is a search of the text of the review.
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.