Design Trade-offs

When the engineers at Boeing design a passenger airplane, they constantly have to trade off safety, fuel efficiency, passenger capacity, and production cost. Programmers rarely have to make those kinds of decisions these days. The assembly programmers of yesteryear had tough decisions between using lots of memory (space) or making the software fast (speed). Now, we almost never face such speed/space trade-offs. Our machines are so fast and have so much RAM that once-beloved hand optimizations rarely matter.

In fact, our computers are so fast that modern languages actually waste computing resources. With an optimizing compiler, C is just as good as assembly language. C++ adds virtual method lookups—requiring more memory and an extra level of indirection. Java and C# add a complete intermediate language that runs in a virtual machine atop the normal machine. Ruby[62] interprets the entire program on every invocation!

How wasteful. So why is Ruby on Rails so popular? How is it possible that Java and C# succeed? What do they provide that makes their waste worthwhile? Why aren’t we all programming in C?

[62] Prior to Ruby 2, that is.

Get The Art of Agile Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.