|
The Story of Mel
http://www.pbm.com/~lindahl/mel.html
This is an amusing story about a programmer named Mel who wrote a blackjack program
with so many optimizations that it was impossible for others to maintain his code.
The author describes Mel as "an unsung genius," which he probably was,
but what grade do you think he would have earned in 6.170?
As impressive as Mel's tale is, how long do you think it took him to write his blackjack program?
Consider how much time he could have saved had he written the same program in a modern, high-level
language. Then think about how much time Mel would have saved his fellow software developers
if he had written more readable code. Spending so much time on optimization is often an expensive
investment in programmer time, both for the programmer who is doing the optimization and for
the programmers who have to maintain the code later on.
As Bloch says in Item 37: "Optimize Judiciously."
By this, I do not mean that optimizations are a waste of time; however,
optimized code does not have to be without abstraction barriers, as Mel's was.
In general, I believe that time is better spent on developing a good design
with well-defined abstractions than it is on optimizing code.
Hopefully, you will learn the benefits of good abstraction in the remaining
problem sets, as well as on the final project.
|