dinsdag 11 maart 2008

Getting started with Rails is easy. Or isn’t it?

Ruby is a programming (scripting) language that is becoming popular lately. As a programming language it is said to be very elegant, but its API isn’t quite as extensive as Java’s yet. At the moment I have two graduates at Logica looking at the possibilities of building (cross-platform) applications in Ruby.
But the real popularity of Ruby comes from the webapplication framework “Ruby on Rails” or just Rails. This framework is said to give you 10x more productivity. When you have mastered the subject, that is.

In some ways those Ruby & Rails guys are pretty good at promoting their stuff. Looking at the amount of tutorials, blogs, websites and tracks on QCon you can’t escape the feeling that this is an important development. But in other ways they suffer from the same problems that plaque the open source world. To get started with a technology, you already have to be quite an expert on all sorts of tools and products. Documentation isn’t really userfriendly or up-to-date and when the inevitable problems arise you have to put in quite some work to get the right answers. If you’re lucky Google will hit some forum with a readymade answer. But if you’re not you’re on your own. Another quibble I have is that the available documentation often isn’t structured clearly. If the open source world wants to interest the less technological savvy, they have to lower those barriers. But we all know that developing is much more fun than writing accessible documentation. So who will do it? (But there *is* an incentive. If you’re tutorial/blog/… is so good that it attracts a lot of visitors, you can make money on the ads.)

So yesterday I tried to prepare myself for the QCon tutorials by getting started with some Ruby on Rails. This wasn’t a picknick. As it turns out Rails 2.0 was released in December 2007, breaking every old tutorial there is. Now they could mention this clearly somewhere, but they didn’t. So to save you the time, I’ll give you course I eventually followed.

1. Rails environment (Windows): download and install the all-in-one distribution InstantRails.
2. You can check your installation by testing the pre-installed ‘cookbook’ and ‘typo’ applications. The cookbook works for me, but typo gives several errors that I couldn’t solve quickly with the help of Google.
3. The readme suggests starting with the popular ‘cookbook’ tutorial. It’s a funny read but … this tutorial turns out to be broken for this latest distribution of Rails. And you only find that out after you’ve invested some time, ran into problems and started searching the web.
4. After some searching I ended up with the tutorial at http://fairleads.blogspot.com/2007/12/rails-20-and-scaffolding-step-by-step.html . This is hailed as the best tutorial at the moment. It does the job and results in a working example. But it only scratches the surface.
5. If you want to know more, the best way to go is to install a previous version of Rails. In this way you can tap into the more extensive older tutorials. You could also buy a book, but there’s not so much on 2.0 yet.

Let’s see what the experts at QCon have to say on the subject.

Geen opmerkingen: