First Steps on Rails

So you hear a lot of stuff about the great productivity of Rails. You see the video, go throughsometutorials, buy the first book about Rails, and you’re stunned about how Dave Thomas cranks out feature after feature. In only a few hours, you have something put together that’s close to a small online shop. You read on and are amazed about the features of Rails. Those guys seem to have thought about everything a web developer could ever need (well, for most cases, but think of the 80/20 rule). So what’s the great deal about Rails? Obviously there’s the beauty that Ruby is. A slick little language that brings everything you need (well, except good Unicode support, but they don’t seem to like Unicode at all in Japan). It’s the complete implementation of DRY. It’s the tight integration of unit testing. The latter is amazing. It’s so darn easy to test everything from the model to the controllers and even parts of the web application. Fixtures (fixed test data creation) are built in and the database is clean on every run. What more could one wish for? It certainly isn’t perfect, but as James Duncan Davidson put it, the point is to get you into high gear fast and deep into the water, and all that without much hassle.

This sounds as if Rails is the perfect match for the web developer’s every-day-problems isn’t it? It did sound/read like that to me. So what’s the next step? Certainly starting to work on your very first Rails application.

At first it’s all a little bit weird, no matter what background you have. I shied away from web development after developing with PHP for 3 years. I don’t want to start a discussion about PHP here, but truth is you get somewhere fast. But for a price, be it code quality, maintainability, you name it. Java on the other hand is very talkative. You need quite some code and configuration files to get somewhere. I haven’t had the joy to develop with Struts yet, but I maintain the build process for an app including web components built with it. And it’s no joy to see how many lines of code it takes to get that web application going.

So there are mixed impressions here. There’s clean code, separated nicely, and there’s less code, well structured from the very start, and all of that by convention. Everything feels natural, nothing is forced on the developer, instead conventions are used throughout the framework which are something like a recommendation, not an enforcement (hello legacy schema). It takes some getting-used-to, but once you’re there, it’s a great pleasure to work with it. There’s loads of documentation available, a well filled Wiki, and a nice community waiting to help. I had to get some rocks out of the way, especially when it comes to testing, but that’s the difference between the stuff you read about and the practical part, where you’re taking your first steps into the new world by yourself. The best thing about Rails is that it doesn’t feel like developing a web application. You code a little, test a little, and do some HTML, or AJAX if you will (a breeze with Rails). But altogether it feels like developing a normal application (at least it does for me). It’s new, it’s exciting, it’s worth giving it a shot, what ever preconceptions one might have (that goes for every technology, by the way).

So where does the spoken-of productivity come from? As you’re diving into Rails, that’s not easy to say. But as you learn to hold your breath for a longer time under water, and get to know the facets of Rails in more detail, things definitely come along easier. It’s not the scaffolding (although that can give you a nice head start), it’s the stuff Rails does for you (meta programming galore), it’s the easy testing facilities, and, last but not least, the wonderfulness and simplicity of Ruby.

Rails definitely did something for me. It made me realize that developing for the web can be a pleasure. And that’s A Good Thing™. Now I’m looking forward to the adventures to come with Rails.

ONLamp just put up a nice overview about Rails and its components.

One Response to “First Steps on Rails”

  1. nathan allison says:

    two thumbs up!!! : , ,

Leave a Reply

You must be logged in to post a comment.