Skip to Main Content
The Rules of Programming
book

The Rules of Programming

by Chris Zimmerman
December 2022
Beginner content levelBeginner
343 pages
7h 36m
English
O'Reilly Media, Inc.
Audiobook available
Content preview from The Rules of Programming

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Programmer's Brain

The Programmer's Brain

Felienne Hermans
Design It!

Design It!

Michael Keeling
The Art of Clean Code

The Art of Clean Code

Christian Mayer

Publisher Resources

ISBN: 9781098133108Errata PageSupplemental Content