2 ms·
Several times I've heard novice programmers cite the "premature optimization" saw as an argument against doing things that weren't optimization at all. Handlin
by kragen 9y ago
Several times I've heard novice programmers cite the "premature optimization" saw as an argument against doing things that weren't optimization at all. Handling edge cases correctly, for example, or throwing exceptions instead of returning incorrect results, or handling two input formats instead of one, or tolerating trailing whitespace on input.
"Optimization" means "making code run faster without changing what it does". If you're changing the code's behavior in an observable way, that's not optimization.
- maxxxxx 9y agoAlso things like copying huge arrays back and forth or hammering the database repeatedly.