Friday, August 8, 2008

Getting Started with Ruby on Rails

Background

I have a background in professional Win32 API C/C++ development. Here is my experience learning Ruby on Rails (RoR). I started a little over a year ago with Rails 1.2. Although rails has jumped to 2.0.2 at the time of this writing, I would still recommend this approach until the next editions of these books come out because they teach the core fundamentals of RoR in a full featured application (named "depot"). Rails 2.0 only adds goodness.

(feel free to add comments on how you learned RoR or suggestions on how you would learn it now).

Trying to learn Rails, Learning Ruby, then Learning Rails

I picked up Agile Web Development with Rails (AWDwR) at a bookstore and what struck me instantly was the thoughtfulness behind the framework: the architecture, the database object mapping, unit and functional tests, logging and so on.
It was as if someone decided to aggregate best practices into one place for me.
I was hooked. The only problem was that I didn't know Ruby so reading the code was like trying to read about Existentialism in the original French. So I immediately went back to the bookstore and bought Programming Ruby (aka The Pickaxe Book).

Read these cover-to-cover while following along with your computer:

1.
Programming Ruby; then
2.
Agile Web Development with Rails

Optional Books to Really Learn Ruby and Ruby on Rails

After you feel comfortable with RoR, I would recommend reading The Ruby Way and browsing through all of the cookbooks on Ruby and Ruby on Rails. There is a lot of overlap in the cookbooks, but there was always a few new ideas in each which make it worth it.

Development Environments

Although it would seem that the RoR Police force every developer to use TextMate on the Mac, it just isn't true. The only thing consistent with RoR developers that I've talked to is that each one uses a different development environment. I've heard: vi on Mac, emacs on Mac, Komodo on Mac, Netbeans on PC, RadRails on Linux, etc, etc, etc. Try some out, pick the one you like and don't worry about what anyone else thinks... at the end of the day you will be producing great web applications and services that will be instantly recognizable and usable by any RoR developer.

My Starting Development Environment

I learned RoR on Windows so I followed the instructions in AWDwR and installed InstantRails. This was great to learn on (and I wrote several significant prototype applications with this setup), but I don't use that now. (see next post)


No comments: