jamin on August 2nd, 2005

I recently had the task of designing a new web application for a very niche purpose (more on that in a later post). While I’m not a web programming expert, I have done some PHP/MySQL development at my last job and have dabbled with CSS and Javascript tricks at various points. I briefly considered using an application framework like Zope but came to the conclusion that it was overkill and too steep a learning curve. One of the requirements for my application was that I had to get it up and running in just a couple weeks. I knew I could write it in PHP/MySQL but I dreaded doing it and knew my code would be somewhat sloppy if I were to make the deadline.

Since I do not live in a cave, I had of course read about Ruby on Rails which is self-described as being “a full-stack, open-source web framework in Ruby for writing real-world applications with joy and less code than most frameworks spend doing XML sit-ups.” Normally I wouldn’t even consider learning a new language (Ruby) and a new framework (Rails) with such a short deadline, but I had read the tutorials, seen the demo movie and heard all the hype and figured if half of it were true, I’d have a shot.

So I set out. I purchased the beta PDF of Agile Web Development with Rails and skimmed through Why’s (Poignant) Guide to Ruby. That was more than enough to get me past the brief birds-eye-view that the various tutorials give. Then I started writing code. I managed to go from nothing to a working application over a weekend. And while this isn’t a massively complex app, it isn’t trivial either. I have 7 or 8 database tables including a join table, interesting relationships between the tables, user management and authentication to give only administrators permission to view and edit certain data, and form validation. All that without composing a single SQL query string.

The three things that impressed me most about Rails are:

  1. How complete the platform is. Want to add authentication, form validation, or AJAX to your app? No problem. Might only be a few lines of code.
  2. How many lines of code you save. Code reuse is very easy and encouraged. And Rails does so much that traditionally you would have to code yourself.
  3. How Agile Rails is. I had my application working but wanted to move my FAQ from being static content to being stored in the database and easily maintainable by administrators who are logged into the site. It only took me about 20 minutes. With Rails it’s very natural to build on your application in short iterations, slowly enhancing it while always keeping it usable and without having to do a complete redesign or spec out the entire thing at the onset.

Tags:

2 Responses to “Thoughts on Ruby on Rails”

  1. I’ve been thinking of playing with Rails for a while myself. Your experiences are encouraging in that regards, thanks.

    Also, don’t know if you knew there are Python and PHP frameworks being developed in the style of Rails. The Python one is Django and the PHP one is Cake.

  2. Thanks, Daniel. I’ll keep my eye Django and Cake as well.