3 ms·
"Premature optimization is the root of all evil" is an amusing quote with some truth to it, but it's brought up as some kind of absolute law these days. I've s
by theprotocol 8y ago
"Premature optimization is the root of all evil" is an amusing quote with some truth to it, but it's brought up as some kind of absolute law these days.
I've seen it given as an answer on StackOverflow, even when the question is not "should I optimize this?" but more like "is X faster than Y?"
We need to stop parroting these valuable, but not absolute mantras and use common sense.
- ajnin 8y agoCrucially people miss the word "premature", that I interpret as meaning that you should not optimize before you've measured that the piece of code you're considering is actually causing performance issues in your program, but if you have the data then go for it.
- theprotocol 8y agoAgreed. They're going by the heuristic that every case they encounter is probably premature
- vanderZwan 8y agoThe quote really should be something like "optimization without empirical data is the root of all evil" to avoid misunderstandings (first thing that came to mind, I'm sure there's a better but still short description still)