The Hyperpessimist

The grandest failure.

Seven Languages, Week 1: Ruby

You should learn a programming language every year, as recommended by The
Pragmatic Programmer. But if one per year is good, how about Seven Languages
in Seven Weeks?

Bruce A. Tate Seven Languages in Seven Weeks: A Pragmatic Guide to Learning Programming Languages

Learning programming languages has been one of my hobbies since quite some time. The thrill you get when learning the basics, when things start to make sense, when you get a compiling program as a reward, when you take your first code and shorten in to one third of its original length is great. The more you know about a certain language, the harder it gets to learn something new and the more esoteric and useless the features you learn get. This is the point where I am with Python: if I were to judge, I’d say it is about as close to an optimal language as it can get. At the same time, it is boring and well explored. Contrast that to Factor where every simple program will take at least a day to write because you need to wrap your head around Factors style. I’m not saying this is better, but it certainly is more exciting.

So during the Black Friday sales I managed to buy Seven Languages in Seven Weeks 40% off and started a study group with some of my friends. Turns out this book is the new rage among my friends.

Week one started easy, with Ruby. We all knew some Ruby or Python and so Ruby wasn’t that much of a change for us. The writing style in the book is somewhat a little too cheerful for my taste, I don’t really need to compare Ruby to Mary Poppins, but I like that the book concentrates on the code and not on installation or stupid basics like how an if statement looks like.

In the Ruby chapter, they introduce metaprogramming. Which is a good idea, for sure, the only problem being that it makes it super complicated and messy. The metaprogramming examples do not make anything easier and my question why I should prefer mixins over (multiple) inheritance were not answered.

Overall, our group didn’t like Ruby that much. Some didn’t like it because it was dynamically typed, some because it was too similar to Python. A specific problem we ran into were the quite useless syntax error messages of Ruby 1.9.3. I dont’t think dumping internal token names to the user of the language is a good idea. Usually the errors were missing commas, so if the interpreter could check some common classes of errors, that’d be awesome.

Next week is Io and I look quite forward to it. I haven’t yet used it but from the introduction I could happen to like it.