Ruby Wizardry

After leaving the lands of Pascual and C, I didn’t fully come back to programming until I learned of the Invent Your Own Computer Game With Python website. I had tried C++ and Java with object-oriented programming methods and I just couldn’t get it. With IYOCGWP it started to click, thanks to the clean design of Python. I had always heard of Ruby on Rails, but not too much of Ruby itself. That changed with a Humble Bundle of programming books; the base level, where you can choose what to pay, included the book Ruby Wizardry. I had heard good things about No Starch Press, and I wanted to give Ruby a try, so I purchased the PDF and began my Ruby journey.

The book starts out very strong. At first I was perplexed, however, why a programming book aimed at kids weighed in at over 350 pages. The beginning chapters are quite engaging, as we’re introduced to the King and two young programming ingenues, Scarlet and Ruben. As more and more things break down in the kingdom, Scarlet and Ruben assist the King to fix the Ruby-powered devices. This is a very engaging and ingenious way to encourage kids (and adults!) to keep reading and exploring the increasingly-intricate concepts and syntax.

Oh boy, the syntax. Evidently Ruby has a number of ways to notate things such as loops and interations, and the author is only too happy to dump all of this on the reader at once. Seriously, in the Staying in the Loop chapter Scarlet shows three different ways to write a loop. The concepts and syntax is just too much to take in at once for a Ruby programmer; I can’t imagine what a kid, let alone an adult beginner programmer period, would think of this. I had to stop reading and take a break to try to digest all of that. In other words, the pacing and complexity ramped up way too much way too fast. This is a critical failure, especially in a book aimed for kids. Why not just stick to one way to notate loops and integrators, and then later on introduce alternate syntax? Is this also a failure of Ruby, by having all of these different ways? Compared to Python, which is just so much simpler and more logical looking at its code and syntax.

One other great fault of Ruby is its software. First, the irb is simply a command line; there’s no text editor, debugger, or anything else. Again, Python includes so much more. Also, on my Ubuntu system, which has Ruby 1.9 instead of 2, I have no idea how to easily install 2 and use that by default. There’s a Ruby2 package in the App Store, but that didn’t change anything. There’s nothing on the Ruby website either. So, at least OS X includes Ruby2, and there’s an easy installer for Windows. For Ubuntu, I guess I would have to upgrade to 15.04 or wait for 15.10, and I have no intention to move to a non-LTS Ubuntu.

I’m currently working on the chapter dealing with arrays and hashes, and it’s still somewhat clicking for me. Of course the kids in the book have dumped a bunch of new syntax, and without any larger or book-long project to implement these items most of it is just flying through my brain and out of it just as quickly.

I’m certainly glad I didn’t pay full price for the PDF or the book, or I would definitely feel it was money wasted. I like the direction the author was trying to take, but ultimately I have to say he failed. Does this permanently turn me off of Ruby? Well, if Python didn’t exist I would certainly still keep at it, but with the clean, simple, one-true-way of Python, I think my limited free time is better spent on that language. There is a python book from No Starch Press that’s in a similar vein to Ruby Wizardry, so I may take a chance, provided I don’t find a better book first.