Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

And if you try to bring up perf at any point during the design phase, people pull the ”Knuth said premature optimization is the root of all evil” card. As if you could design and build a Ford Pinto, then hotspot optimize it into a Saturn V


  > people pull the ”Knuth said premature optimization is the root of all evil” card.
Incredible how so many people misuse quotes and end up undermining the the whole point of the quote.

So for everyone that doesn't understand, here's the longer quote

  There is no doubt that the holy grail of efficiency leads to abuse. Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.

  Yet we should not pass up our opportunities in that critical 3%. A good programmer will not be lulled into complacency by such reasoning, he will be wise to look carefully at the critical code; but only after that code has been identified.
Knuth said: "Get a profiler and make sure that you're optimizing the right thing"

It is incredible how this became "don't optimize".

  https://dl.acm.org/doi/10.1145/356635.356640
  (alt) https://sci-hub.se/10.1145/356635.356640


I guess he was thinking that u might not need Saturn V. If u later decide based on more info that u need it, drop the old work and make perfy version from 0. I yhink that is reasonable given how much more work and resources it requires


Was Knuth talking about deployed software when he wrote that?


He wrote that in 1974. Software products were orders of magnitude smaller back then.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: