Could you go live with less than 600 lines of code?

37signals did when they released ta-da list back in 2005. You read that right, not 60K or 600K but instead a commercial project in <600 lines of Ruby code. When I first saw this number I was incredulous – I’ve written stored procedures that are longer than that. My current project has more lines of configuration (and maybe even more configuration files..OK, maybe not) than that number. I’ve even written console apps in notepad, and compiled from the command line with more lines than that, because I thought they were so small they didn’t need a whole .sln and .proj file, and yet here are 37signals going live with a product that is just 579 lines of Ruby.
They had a number of things in their favour, which presumably allowed them to do this:

  • They wrote the rails framework, and thus presumably knew how to get the most out of it. The equivalent in the .NET world would be Scott Guthrie and Nikhil Kothari getting together to write an ASP.NET task tracking application.
  • They situated their product squarely in terms of the solution technology domain. They didn’t need (or more likely chose not to use) any custom widgets. Spitting out simple HTML is not hard. Building large and complicated controls that have to maintain state between requests, render differently on different browsers and handle complex validation is.
  • This number is just the Ruby code, not the associated CSS, JS etc.

Even considering these caveats, I think this is still an amazing accomplishment, which takes minimalism in “production” code to a whole new level. This got me thinking – I have a few interesting product ideas from time-to-time. What is the absolute minimum amount of code I could write that would make that work? If I’m prepared to operate within the constraints of the platform (whatever that is) how much effort would that save me? How many more “interesting ideas” could I turn into working products if I was prepared to follow these constraints? How many more cool/useful things could you build if you promised yourself that each one would only be 600 lines of code?


Great idea!

i like to think that removing 20% of the features reduces the development time by 50%.

the other night i wrote a ‘production’ app (the world’s simplest code generator [javascript edition])[] in a few hours and published it next morning, because it was so deliverately feature-starved – maybe 20 lines of real code.

meanwhile the desktop version of this same product has been on my backburner for over two years now. it’s feature list is massive – and it will probably never get off the ground. Elephant, yes?

being proud to head for the simplest implementation possible is a real benefit.
16/08/2007 5:32:00 PM
I didn’t know that fact about 37signals, but Rails’ ease is why I’m trying it on my first commercial product, even with six years ASP.NET experience.

Thanks for this reminder of KISS - I think I had already designed in a kitchen sink!
24/08/2007 8:13:00 PM
Loup Vaillant
The earliest versions of Xmonad were less than 500 lines long. And it is a fully fledged window manager. As far as I am aware, the code base didn’t grow much since (at least for the core application).

As the name suggest, it is written in Haskell. Their hompage is here:
25/01/2008 5:27:00 AM
It would have been shorter and faster if they had used

even taking into account that you can cheat with rails, because ruby allows to put as much code as you want in one line.

25/01/2008 8:19:00 PM