Ruby on Rails: The importance of being 1.0
David Heinemeier Hansson is the Danish creator of Ruby on Rails, a Ruby-based, open-source development framework that has seen rapid adoption since it was first released in 2004. Rails takes a different approach to software development, what Hansson calls "opinionated software" — sacrificing some flexibility in favour of simplicity.
The result is intended to be much greater productivity and a better developer experience, and judging by the rapid adoption of Rails, many seem to be finding that it works. Even large organisations are bringing Rails into play, with the BBC using it to Web-enable its database of decades of television and radio programmes. The framework has also attracted its share of criticism for limitations such as its lack of support for some common database features. Rails 1.0 was released in mid-December.
David recently relocated from Copenhagen to Chicago, where he is partner at 37signals, developer of the Basecamp project-management system and other Web applications. He spoke to Builder UK about aesthetics, open source and the joy of programming.
Q: How did you first get interested in Ruby? What was it like learning the language?
A: I was burnt out on programming in PHP and Java. No matter how hard I tried, I didn't seem to be able to stay as productive as would deem reasonable for the task at hand. I would continuously be bogged down by the mundane drudgery of working for the compiler – writing code that didn't make the program explain itself better to me or my collaborators, but just to make the compiler happy.
So I was receptive to a breath of fresh air. And Ruby came to my attention at exactly the right time. It took me just a few days to realise that I really liked it, and about a week to create enough proofs-of-concept to convince myself that it would do the job for the next application I was embarking on (Basecamp), and about a month to get me so much more productive and happy about programming that I swore never to return to either PHP or Java.
And that was even in the days before Rails was Rails. Today, the adoption phase is often much faster. I've hear people swear off their previous environments after just a couple of days on the Rails.
You've said a big part of going with Ruby was simply that it made you happy. This factor isn't talked about so often in discussing the merits of one language over another — why do you think that is?
The language is extremely important. Rails is Rails because of Ruby. It's Ruby that allows for the flow, the succinctness, the beauty, and ultimately the joy of programming with Rails. So while frameworks in other programming languages can certainly attempt to learn from what we did in Rails, they can never recreate the complete experience. It's intrinsically tied to Ruby.
That's not to say that you can't create another framework that'll be cool or "better", for whatever metric you choose to determine that in. Just that it won't be Rails.
Anyway, Ruby makes me happy because it allows me to write beautiful code. Aesthetics are strongly linked to enjoyment. It's not just about "getting the job done". It's also about being satisfied with the way the job is getting done – being motivated to improve the way the job is getting done, and to take pride in its execution. I simply can't do that with ugly code. Ruby allows me to escape the ugliness. Thus, Ruby allows me to be happy about programming. Happiness leads to motivation. Motivation leads to productivity.
Why do you think Ruby isn't better known? It's been said Ruby's 'Perl-ishness' is a bit old fashioned, do you agree?
Perl burned a lot of people. Either directly or from stories about it. So it's only natural that people react with caution when they see a new programming language that doesn't hide the fact that it learned a few tricks from Perl. They assume that since this one feature is there, like having regular expressions as first-class members of the syntax, it will carry over all the ills they felt from the complete Perl experience. But that's of course silly.
Ruby took a handful of ideas from Perl and put them in a context where their potential to do damage is heavily discouraged. While the features themselves may appear similar, their context of use is different enough that the leanings of the past simply don't translate. But that's of course a hard sell. Once burned, twice shy.
Just to be clear, however: While I sympathise with cause of the concerns, I also consider them flawed. Ruby got a ton of great ideas from Perl. We should be proud of that fact. Take what works, recontextualize it, and prevail.


