Ruby Report

Well, well, well… What do you know? I’ve given Ruby and Rails a bit of a try over the past two weeks and I’m pretty intrigued. I had fully expected to dig into Ruby/Rails and see that it was just smoke and mirrors used to make slick demos. But instead I keep finding more reasons to like it and often for different reasons than other people have said.

The main thing that bent my spoon is the way the development environment works with you to help you develop rather than fighting you. You can set breakpoints on the fly. The web server (when launched for Rails) knows when it is in “development mode” and provides informative error messages. There are built-in functions for inspecting objects ( debug(@object) ) and introspection is trivial ( p @object.methods.sort ).

Rails is pretty slick as a web framework. Lots of nice little things like flash[], which is a HashMap that lives through one redirect so things like error messages carry forward. Rails has configurable URI mappings which will automatically pull parameters from the URI (like /:controller/:action/:id). At OSCON, David Heinemeier Hansson said that Rails has (by design) limited flexibility to improve productivity. I have no idea what he meant by this. There are 6 ways to configure session persistence and 4 ways to configure HTML fragment caching. Plus, the fact that you can pretty easily modify any object or method means there is no shortage of flexibility.

The ActiveRecord bits of Rails seem decent enough and I haven’t tried out the more sophisticated mappings to see how well they work, especially compared to something like Hibernate. But for straightforward or slightly complex mappings, they work just fine.

I’ve just started getting into the meta-programming aspects of Ruby. The ability to meta-program is what makes Rails feel like part of the language and not just a library that’s being used.

Anyway, if you haven’t taken a look at Ruby on Rails yet, do it. And Bobby, I take back all of those nasty things I said about scripting languages.

Comments are closed.