Ruby

I’ve got a Ruby book “The Ruby Programming Language” by Flanagan and Matsumoto (or should I say the Ruby book?) as a New Year present. I am only starting the reading, so I am going to keep my comments here. This is what I have so far:

– I don’t like the “end” keyword. It is so Pascal 🙂 I would either do away with it altogether, like in Python or come up with something shorter like in C

– I like a lot the embedded expressions for string formatting: "I have #{count} symbols" is so much better than String.Format("I have {0} symbols", count);.

– I am on the fence about “if” and “unless” modifiers that come after the expression, as in
Raise Invalid, "x is too big" unless x<10. It might be closer to the natural language, but overall I don't think this is such a good idea, especially for longer expressions.

- I am somewhat puzzled by the octal notation in the character literals. E.g. "\010" means ASCII character 8. Who uses octal in the 21st century?

Leave a Reply

Your email address will not be published. Required fields are marked *