4 ms·
The original premature optimization quote is not at all talking down. 3% of my code is pretty close to what fraction benefits from microoptimizations, and it i
by aidenn0 11y ago
The original premature optimization quote is not at all talking down. 3% of my code is pretty close to what fraction benefits from microoptimizations, and it is about "small efficiencies." It is useful advice for a novice and does not become less true as one gains in art.
"Don't optimize" would be the talking-down version.
"Don't optimize prematurely" is naturally tautological. "It is wrong to do X prematurely" is true regardless of X; if it isn't wrong to do X at this point in time, then doing X now isn't premature. It's closer to the pop-culture version of the advice, and like any tautological advice can always be wielded against someone. It's worse than "talking down," which can reduce the mental load on a novice, it's actually not-useful at any stage, as it provides no advice on when optimization is premature and when it isn't.
The pithy version of Knuth's quote might be "Don't microoptimize until you can tell the difference between the 97% of code that doesn't need it and the 3% of code that does" which is in line with pretty much the entirety of your comment.