Skip to content
quotesby

About this quote

What does it mean?
Optimizing too early causes more harm than good in programming.
In plain terms
Do not try to speed up code too soon.
What can you take from it?
Focus on correctness before speed.

Where it applies

  • coding
  • development
  • architecture

Putting it to work

  • write clean code first
  • profile before optimizing
  • avoid premature tweaks

Questions to consider

  • When is optimization right?
  • How do you prioritize code?

Another view

Some optimizations are needed from the start.

More from Donald Knuth

  1. Beware of bugs in the above code; I have only proved it correct, not tried it.

    Permalink to quote #2
  2. I can't be as confident about computer science as I can about biology. Biology easily has 500 years of exciting problems to work on. It's at that level.

    Permalink to quote #3
  3. The psychological profiling [of a programmer] is mostly the ability to shift levels of abstraction, from low level to high level. To see something in the small…

    Permalink to quote #4

Related quotes

  1. And in the limiting case where the optimizer is completely broken because it's not implemented yet, we get to work around that too. Optionally...

    Larry WallLarry Wall quote #234
  2. Simplicate, then add lightness.

    Colin ChapmanColin Chapman quote #1
  3. Beware of bugs in the above code; I have only proved it correct, not tried it.

    Donald KnuthDonald Knuth quote #2