The author, smiling winningly Scott Raymond home

Why Rails

23 Aug 2005

My friend Dusty emailed me today asking for more information about my love of Rails. I’ve been meaning to think through some of these questions anyway, so I figured I’d post them here. He wrote:

“I’m curious if you can finger exactly what it is about rails that feels so refreshing? I finally (begrudgingly) took a closer look at it recently — I’d been avoiding it along with any other web-oriented framework that defines itself as an MVC.”

Like many Railsians, I started programming on the web (many years ago) as a PHP hacker of the worst sort: huge files of proceedural code, jumbled messes of include()s, inline SQL, and HTML. As I matured, I developed conventions to help tighten things up, and eventually had an ad-hoc framework of sorts: Smarty or Savant for views, PEAR DataObject for data access, PHPUnit for testing, and a homebrew library for scaffolding-like admin tools. Although I focused on PHP, I also dabbled with other tools, like Perl, Python, and Java. So what does Rails provide that those things didn’t? For me, it boils down to a few things.

Dusty continued:

“Another question of note — are you using any kind of IDE with rails, or just plain old text editing?”

Plain old text-editing. I’m using TextMate, certainly the best text editor I’ve ever used (although I admit I’ve never mastered vi or emacs). I would love to see an IDE come around with first-class Ruby support and TextMate’s polish.

“I didn’t get very far at all in rails, but I do really like all the templating and code-generation that seems to be built in, and I really enjoyed playing with scaffolding — I can see how that would cut out a huge portion of the ugly grunt work in the earliest phases of a project.”

I have actually found that in real-world development, Rails’ scaffolding isn’t of much use — in its current state, it’s more of a whizzy-demo feature. I would love to see it expanded to something like Django’s admin interfaces. But then, real projects usually aren’t a perfect fit for one-size-fits-all interfaces, so I don’t ever see scaffolding being a huge deal.

What is a huge deal? Having an extremely “out-of-your-face” language. A framework that values conceptual purity, but not ivory-tower austerity for its own sake. A pragmatic toolkit that lets the easy things be easy. An active and smart community, with a culture that esteems openness and quality.