Premature optimization is the root of all evil (or at least most of it) in programming.
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
Putting it to work
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
Beware of bugs in the above code; I have only proved it correct, not tried it.
Permalink to quote #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 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
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 Simplicate, then add lightness.
Colin ChapmanColin Chapman quote #1 Beware of bugs in the above code; I have only proved it correct, not tried it.
Donald KnuthDonald Knuth quote #2