Learning Ruby On Rails

At the moment, I believe that there are two environments out there that are actually real possibilities if you want to develop web applications without Venture Capitalist funding (that is, without the possibility of burning money) and without going completely insane.

They are Django and Ruby On Rails.

I don’t know Django well; I became interested in it, and then I discovered that it was based on Python. I hope I don’t start a “religious” war when I say that I don’t like Python at all. I say that knowing that I am being thoroughly unfair, because I didn’t really give Python a chance to settle into my brain. However, too many things in Python just don’t work for me, and no, I am not gonna give out a list, because it’s a matter of (I repeat unfair) personal taste.

I am personally left with Ruby On Rails. I got this contract about 3 months ago, and while the first whole month was spent defining the data structure (a scary 48 table, complex database), over the last two months I’ve eaten, breathed, dreamt, you-name-it, Ruby On Rails.

I now have a theory on how it works when you are learning Ruby On Rails. The first and most important thing, is that the book—the fantastic Dave Thomas—is a little too good. Especially version 2 of the book is getting a little too close to perfect. Fortunately, the first part with the famous “Depot application” is now a little too complex for my liking. However, the book as a whole is simply too good. Ruby On Rails needs to be experienced, and not just read about. I think one of the mistakes people make is that they stick to the book a little too much, and forget that the real Master (with a capital “M”) is the API documentation. You will get frustrated at some absurdly complicated sentences sometimes—and in those cases you will probably go back to the book, read in English what the parameter does, and think “Thank (whatever) I’ve got the book”. However, that should be about it. It’s a book people should read 15 to 25 times, but while they develop and while they read the API documentation.

The second problem is that Ruby On Rails is huge. And I mean: HUGE. I thought I sort-of knew it, and I then discovered RJS templates. Then I thought I mastered those, and discovered something else... the story went on and on, until I realised that there was just no way for me to know it all. It was just too big. All I could do, was know a reasonably large subset of it quite well, and discover in the meantime that my memory was getting better and better (to me, that was a nice side effect of learning Ruby On Rails).

The third thing, is to persevere. After about one month of development, my brain short-circuited and decided that it would start to reject RoR. There was just too much: there was a huge big-picture to keep in mind; there was the syntax; there were the little “twists”; there was Ruby—yeah, you know, the language RoR is based on!—that posed more challenges; the list goes on and on, and at one point I honestly thought I just wouldn’t manage. I must admit, the only reason I did persevere was because I was getting paid for it. People were waiting to see the results. I had to deliver. (I am writing in the past tense, but this project is still going on at the time of writing). So, I stuck with it—and eventually, my subconscious started processing things, and everything became more and more familiar. Now, two whole months after day 1 in development (when I knew absolutely nothing about Ruby On Rails, I can finally say “I know it”. Yes, I still need to read the RoR bible (the “Agile book”) about 19 times, but things look familiar now, I know what to expect, I can even do some meta-programming without going insane. That’s the big secret, I think, if you want to learn Ruby On Rails: stick with it, allow it to become more and more familiar, let your subconscious absorb it and spit it out once, twice, three times.

So... right now, I am a Ruby On Rails “believer”. I would still use Drupal to create Free Software Magazine’s web site (what do the experts say? The right tool for the right job...), but I would only use Ruby On Rails for web applications.

Hopefully, if you are one of those people who stopped learning it because they got discouraged by RoR’s size, this short article will give you some extra tools to go back to work with so you can actually enjoy being a programmer.

License

Verbatim copying and distribution of this entire article are permitted worldwide, without royalty, in any medium, provided this notice is preserved.