Silver Bullet on Rails?


I am giving a presentation on Rails at the Washtenaw Linux Users Group this week, so I thought it would be a good time to get a few ideas about productivity and Rails out of my head and down on paper.

I’ll post a link to the presentation later this week, but for now, I’d like to explore the big hairy audacious claim that’s been floating around there about Rails. People have said that they are 10x more productive in Rails than they were in Java, Struts, and Hibernate.

What makes this claim so controvercial is that it goes against the received wisdom that in software development there is no “silver bullet.”

So I thought it would be interesting to take another look at the 1986 essay that started it all No Silver Bullet by Fred Brooks. Which in my experience is much more widely talked about than read. I’d like to highlight one quote:

How much of what software developers now do is devoted to the accidental, as opposed to the essential? Unless it is more than 9/10 of all the effort, shrinking all the accidental activities to zero time will not give an order of magnitude improvement.

I think this gets to the essence of the problem. How much of what we do is dealing with the quirks and idiosyncrasies of the technology we use, and dealing with extraneous implementation details? The Lean Manufacturing side of my brain says we should probably be asking this question another way — “How much of what we do is Waste?”

If you follow the logic, what Fred Brooks is saying is not that an order of magnitude of productivity enhancement is impossible, just that an 10x improvement would mean that:

  • 90% or more of what we do now is waste
  • we can cut that waste to near zero

While they may seem like absurd statistics, I think both of them are often true.

Your customer wants working code — not meetings, detailed design specifications they can’t even understand, and bug lists!

Outside of IT, there are studies that show that many product development teams have %80 of their time allocated to non-value added activities. This is also true of software teams who spend time on status update meetings, communication planning, scope control, and training. And processes like CMM level 4 certifications often buy repeatability by increasing the burden of non “value-added” tasks.

Your customer doesn’t care how much code you produce, they just want software that works!

This gets us to the heart of the Rails proponent’s claim that using it can make you more than 10x more productive than you were in Java. This claim is based on the idea that even when you are actually sitting in front of your computer writing code, you there’s still waste that can be removed.

Ruby, Python, and Perl, as dynamic languages reduce some of the overhead of Java’s type system. And Rails reduces to near zero the effort required to keep the database schema, ORM code, and model objects in sync. Rails also reduces the mental overhead produced by non-intuitive naming conventions. So, there is certainly some real, and measurable improvement in programmer productivity just by moving to Rails.

The bad news, is that this isn’t going to make you 10x more productive. So far, the best study I’ve seen is shows that Rails has about %60 less code than the equivalent Java. If this is right it means you might be three times as productive in Rails as you would in Java.

Nice, but no silver bullet, right?

Well, there are also other benefits of working in Rails.

Since most Rails applications are developed by smaller smarter teams, there tends to be less team communication overhead on a rails project. Not only that but the nature of Rails development encourages incremental delivery, that removes a lot of waste in terms of over-specification, developing un-used features, and maintaining a complex scope control system.

Rails also includes easy ways to do unit and functional tests, which can significantly decrease the amount of time you waste finding and fixing bugs.

So, what’s the bottom line?

Using a dynamic language like Ruby means less code, which makes you faster. Rails’ full stack integration, means less code which makes you faster. Rails philosophy of convention over configuration means less XML configuration files, which makes you faster. Rails inclusion of a test environment by default, as well as a convenient unit testing framework means you are less likely to write buggy code — and that makes you faster too. All this plus the productivity gains from not having to communicate with a large team and the ability to easily do iterations, can definitely make you ten times more productive.

That said, you could probably get most of this from running another web development framework in a dynamic language, and working with a small team, and doing unit testing.

3 Responses to “Silver Bullet on Rails?”


  1. 1Anonymous

    I just finished my first Ruby program. I’m very familiar w/ Java and C++, and I’ve dabbled with Objective C. The program is modest, only about 160 lines of code, but it was a nice way to get familiar with the language.

    I’m curious why a “dynamic language” results in less code than other languages. I’m assuming you’re contrasting dynamically typed languages (e.g., Ruby and Objective C) with statically typed languages (e.g., Java and C++).

    1. One obvious way is that there are no declarations of variables or parameters. So actual names of types appear in the code far less often.

    2. Also, when one wants to employ polymorphism with disparate classes, it would require the creation of an interface (Java’s term) to link them. With Ruby’s “duck typing” creating the interface isn’t required.

    3. And prior to J2SE 1.5, using any of the collection classes would often require a cast on retrieval. Or to put it more generally, casts aren’t required at all in a dynamically typed language.

    4. One benefit Ruby has is the ability to treat blocks of code as data, and pass them around. I don’t believe this is a necessary capability of a dynamically typed language, so perhaps this item does not belong here. But in Java, if one wants objects with different behaviors to method calls (and not just different data), it would require the creation of a class for each. In Ruby, the differing behavior is data, and thereby can be stored in a variable.

    My first question is whether that list can be expanded.

    My second question is whether the differences listed really add up to all that much extra code?

  2. Also consider that many of the articles and authors touting a “10x speed” over other web development platforms are using the basic built-in features of Rails. I have been playing with Rails and Ruby for a month or so now, and getting to the point where I want to go beyond simple CRUD and scaffold generated controllers, etc. Out on that fringe you run into many of the same problems - business logic and where it lives, etc. - and things slow down a bit. Part of that is learning curve, I am certain, and in general Ruby and Rails do speed things up, but not exponentially so.

  3. anonymous,

    I think you are right on the money on counts 1 through 4.

    Once you get used to duck typing, automatic casting, and dynamic objects you’ll you use them more and more. In particular it drives me crazy in Java when I can’t just subistitute another file type object in place of a file.

    In Ruby it’s easy to start using files, and then just replace them with some other object which has all the same methods as files when you discover that you that extra something. But in Java, when you discover the need for that extra functinality, you will feel like you made a mistake and have to go back and change everything.

    I’m not certian how much code this saves, and it is hard to make apples to apples comparisons because Java, Python and Ruby all have different standard libraries which have a significant impact on the number of lines of code you generate. That said, I would not be supprised if you could drop a third of your code just by dropping variable declarations, using duck typing, and reducing the number of casts.

    I am new enough to Ruby not to have a very good feel for how much code blocks can save me. But so far it seems like it is significant.

    –Mark Ramm

Leave a Reply