For various reasons, not least attempting to "Ajaxify" my web design skills, I have embarked upon learning Ruby on Rails. Most, if not all, of this is pretty new to me. I don't know a great deal (OK, make that nothing) about object-oriented (OO) programming, JavaScript I tend to fly by the seat of pants with (but they tell me Rails will do it all for me...), and the concepts of frameworks and model-view-control patterns are about as alien as wee green men. The philosophy, though, I think I'm pretty comfortable with and I tend to get excited about it so that's got to be a good thing. Also I think I've pretty much cracked XHTML and CSS and the whole web standards and usability thing so I reckon I'm on the right track. So what I intend to do here is track my experiences, both for my own benefit and perhaps to help others who find themselves in the same position as me. There's a whole host of guides out there (some of which I'll come to later) but hopefully my insights will add a little flavour to the mix.

So where to start? The thing that struck me at the outset was I didn't actually know what I didn't know. That probably doesn't make sense, but I guess what I mean is I didn't really know how the things that I did know fitted into the overall jigsaw. So what did I know?

  • There's an object-oriented programming language called Ruby that's supposed to be cool and easy to learn. Hah!
  • There's a "thing" called Ruby on Rails developed by some genius at 37signals.com which forms the basis of new emerging "web 2.0" type applications. I even use their Highrise and Backpack apps.
  • Ajax (Asynchronous JavaScript and XML) makes things even better; the fact that you don't need page reloads is the killer here. I knew too that there was a seminal article about this somewhere...
  • I had a hunch that my previous attempts at learning PHP, Perl and CGI may just have been a waste of time.
  • All of this means you can do some really fancy stuff with your web pages (drag and drop anyone?).

Fitting all of this together with my knowledge of (X)HTML, DHTML and CSS was, and still is, the challenge. The first thing I wanted to be clear about was where Ajax fitted into the mix. Jason Cranford Teague's CSS, DHTML and Ajax was great for this. I've followed Jason's stuff for many years - back to his columns in The Independent in the late 90s - and always found him easy to read. The initial chapters of the book were going over old ground for me, but that was reassuring as I felt I was hitting Ajax at the right level. After reading this I was pretty happy with the connections between page layout using XHMTL and CSS and dynamically serving the content through the Document Object Model (DOM)/JavaScript and the XMLHttpRequest object: the fundamentals of what we know as Ajax. Heh, I'm gettingĀ  somewhere.

My next port of call was the official Ruby on Rails site. I skimmed around there for a while looking at site examples etc (I even managed to divert my attention to setting up a shopify.com site) and trying to get some guidance on what books or tutorials I needed. I found why's (poignant) guide to Ruby pretty good fun and a good place to start learning the basics of OO programming, however I'm a book kinda person so I headed to Amazon.

The reviews on Amazon can be a pretty good indicator to the usefulness of a book, especially in giving an idea of the "level" it is aimed at. The standard textbook for learning Ruby is known as the "pickaxe" book, because it has, erm, a pickaxe on the cover, but Beginning Ruby by Peter Cooper looked a better bet for an OO novice like myself. The pickaxe book is over 3 years old now, too, and I have a general rule of not buying textbooks this old, especially in such a fast-changing environment as web design. So that's Ruby taken care of. Next up was Ruby on Rails, or just Rails as it is often referred to. There's a few books on this but Ajax on Rails by Scott Raymond had the appeal of killing two birds with one stone. It's an O'Reilly book too: you can't go wrong with O'Reilly.

So these books landed on my doormat the other day and I've pretty much finished reading through both of them and I've even messed around with Ruby itself for a while using the Ruby interactive interpreter ("irb") on my Mac; Ruby is installed by default on Mac OS X. But more of that later. At this point I think I may be missing some deeper understanding of both Rails and Ajax but I kind of want to get dirty with some apps under development and then seek further help where I best need it. Agile Web Development with Rails and the brand new Ajax: The Definitive Guide look favourites at the moment. But for now, I'm going to see where I'm at.

Next time I'll relate my experiences with beginning programming in Ruby and installing Ruby on Rails.