Ruby and Rails

I’ve been interested in Ruby on Rails ever since the first screencast made the rounds last year. I didn’t know any Ruby at the time, so I decided that rather than tackle two things at once, I should start with some Ruby and then move on to Rails.

I started reading over the free, first edition of Programming Ruby to get a feel for the language before buying the current second edition. This book doesn’t provide any practice exercises of its own but I found it helpful to do the exercises in my old copy of Learning Perl in Ruby, as well as rewriting some random Perl and shell scripts I have sitting around. Once I felt comfortable with the basics, I moved on to the Rails book, reading and following along by writing the code for the shopping cart application the book uses as an example project.

Ruby is a really nice language, and is about as intuitive as a programming language could be. I don’t know how many times I’ve just made a guess at how to do something and ended up being right. This is particularly impressive considering that, outside of dabbling a bit here and there, I’m not a programmer and don’t have any experience with object-oriented languages (I’m pretty sure OO PHP doesn’t count).

Rails makes Ruby even better. After finishing the project in the book I moved on to one of my own, a simple phonebook application, which I completed, start to finish, in four days, working maybe an hour or two per day. Granted, this is an extremely simple application, and I relied a good deal on Rails scaffolding, but I did some real work as well, adding searching, listing names by first letter, modifying some of the default actions, and playing around with different ways of displaying the output in ERb templates. Not bad for my first attempt, I think. I didn’t add any Ajax or anything fancy like that, but I’ll work on that in my next project. It’s going to be fun.