Interlude: In Which the Previous Chapter Is Criticized
I stand behind the message of the previous chapter—the first lesson of optimization is, in fact, “Don’t optimize.” However! This strongly expressed point of view, alone among the many strongly expressed points in this book, prompted immediate dissent from a large subset of my teammates at Sucker Punch.
It’s only fair to give their well-reasoned objections a hearing! I now present the opposing points of view in the form of an imagined Socratic dialogue between me and the many dissenters, whom I’ve merged into a single character for dramatic purposes. They have all been given a chance to review this chapter to make sure their views are fairly represented.
The Dissenter: I formally lodge my disagreement with the premise of this chapter.1
Chris: I thought this chapter was just common sense. Didn’t you see the Knuth quote? “We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil!”
The Dissenter: That quote has been used to justify all sorts of code with atrocious performance, and you’re just encouraging more of it.
Chris: Wow. There’s an emotional undercurrent to that feedback. Perhaps that’s because you’ve had to spend too much time reworking other people’s code to fix performance problems that shouldn’t have been there to begin with? And also waiting for popular video games to boot?
The Dissenter: Yes. And yes.
Chris: And you work on performance-critical parts of our ...
Get The Rules of Programming 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.