Technology

“But why didn’t you write it in Ruby…?”

I thought I’d answer a question that comes up from time to time about the Java development and redesign work going on for the Guardian Unlimited site: “Why didn’t you write it in Ruby?”

I was reminded of this question because of an excellent post over at Manageability.org in which ceperez wonders aloud whether dynamic languages can scale. The post contains excellent thumbnail sketches of various languages, and the suggestion is that different languages cultivate different habits which have different consequences as an application (or project) evolves. The flipside of this question is Nati Shalom pondering why Java isn’t used more for large scale web applications. Nati’s post is one I’ve kept around for some time, wanting to follow it up, and so this post finally does that.

The question of why the Guardian Unlimited redesign isn’t taking place in Ruby is sometimes asked of me, but most often asked of any of our architects, often following a presentation of our work. Here are some answers.

Developers discuss Java and Ruby1. A personal answer

My own immediate answer to the question is usually a reaction to the fact that it is too often asked by certain kinds of people. These people are the Kool Kidz who have picked up Ruby on Rails over a weekend, created a blog in 15 minutes, sneaked a Ruby script onto their company’s servers, and are so delighted with their new toy that they think it should be the basis of the multi-million pound invoicing system currently wanted by the Accounts Department, which they’d quite like to build if they can use Ruby but which they have no intention of sticking around and supporting for the next ten years.

Unfortunately my personal answer to these people contains too many expletives to be included on a family blog.

Just as well we’ve got some other answers, then…

2. Confidence

Ruby might be a terrific language, with good support, and it might be really reliable. But the redesign work that’s going on now produced its first public release in November 2006. So the work will have started a few months before then, and the planning a while before that. Let’s round it out to January 2006, two years ago from now.

Casting your mind back two years you may recall that Ruby was an up-and-coming language, but it hadn’t really been proven running large scale websites. Sure, 37signals were working with it to great effect, but that’s only one case study, and not of a typical company. If you’re going to sink someone else’s money (that is, your employer’s money) into a big project you have a responsibility to ensure you’ll get results. You’ll want to be sure there is sufficient expertise in the marketplace to call in help when you need it, you’ll need to see several other similar projects that have succeeded with it, and you’ll probably want to know of a few projects that have failed with it so you know what not to do. With the state of Ruby at the time there just wasn’t that weight of evidence that supported its use for our purpose.

3. Scalability and socialness

Finally, a very important factor in our consideration was a kind of scalability, and what one of our architects calls socialness. It’s the scaling of the team.

There’s a world of difference between four-or-so developers writing some software and several dozen developers writing it. The day-to-day mechanics of writing software changes significantly when you’ve got so many developers that…

  • there are too many to fit round the same table;
  • you can no longer rely on saying something aloud and being heard by everyone;
  • you couldn’t possibly have recruited them all if you had wanted Indentikit developers who would all naturally solve all problems in exactly the same way;
  • any code you write is likely to be picked up next by someone you’ve not happened to speak to for more than a fortnight;
  • any code you pick up is likely to have been written by someone you’ve not happened to speak to for more than a fortnight;
  • it’s only to be expected that the people you end the project with won’t be all the same people you started with.

When all this is the case, then code consistency becomes hugely significant, and just relying on people’s own technical and communication skills isn’t going to be sufficient — you need your software to keep you on the straight and narrow. We weren’t comfortable that a language with the fluidity and flexibility of Ruby would provide that.

Postscript

I’ve just made a quick calculation: If quality is compound, and you’ve got 25 developers who each manage to code to 95% of your desired standards, then the quality of your codebase becomes 0.95^25, or 28%. Okay, it’s a pretty spurious calculation, but it goes to illustrate the point that quality is more fragile across a larger team.

In the end, the “why not Ruby” question comes down significantly to historical reasons and human reasons.

And what would we choose if we had to make the decision today? Well, we don’t have to.

Advertisements

Discussion

4 thoughts on ““But why didn’t you write it in Ruby…?”

  1. We weren’t comfortable that a language with the fluidity and flexibility of Ruby would provide that.
    Most of your other arguments apply specifically to Ruby, but this point addresses the wider question – “why didn’t you write it in $random_dynamic_language”?

    Posted by Dave Cross | 23 January 2008, 10:34 am
  2. Dave, yes, of course you’re right. If I was answering the question you formulated for a specific value of $random_dynamic_language, then that third point would be part of the answer, along with some other thoughts which would most likely be specific to that language.[1]

    However, if you don’t mind I don’t have the inclination to answer the question for other languages. It’s very unusual to be asked about them, which tells you something about the advocates of Ruby, or other dynamic languages, or both.

    [1] Assuming $random_dynamic_language does actually reference a language; it’s hard to tell, since it seems to be untyped.

    Posted by Nik | 23 January 2008, 2:22 pm
  3. Anyway, the Ruby backlash has begun ;)
    http://www.zedshaw.com/rants/rails_is_a_ghetto.html

    Posted by Rupert | 24 January 2008, 11:13 am
  4. One thing I think you neglected Nik is tooling support. IDEs, as any zealot will tell you, are a horrible crutch to cover broken languages. However, when you have a team of more than 10 people, it’s really, really important to be able to have a quick tool to find all references to an object/method/onion and whilst a general file search will get you 90% of the way there, developers who aren’t worryingly intimate with the codebase will generally lack the courage to refactor if they don’t have the warm comfort blanket of a search backed up by a compiler.

    There are lots of other nice things about tools, but that’s the really key one from which most flow and the one I can’t see how you’d replicate without a strongly typed language.

    Posted by PhilWills | 25 January 2008, 12:47 am