3 ms·
That's a recipe for convoluted code with no benefit. It's what we call premature optimization.
by lolc 8y ago
That's a recipe for convoluted code with no benefit. It's what we call premature optimization.
- SamReidHughes 8y agoNo, it's called saving effort, because the situation requires determining whether the optimization is worth it anyway. Convoluted architecture is a problem, not some code that's an O(1) rewrite away from being simplified.
- lolc 8y agoI think your definition is off: Optimized does not mean simplified. Optimized code tends to be harder to understand for the reader. And readability is the first metric any code is judged by. If you want to optimize away from the plain version you have to support the introduced loss in legibility with relevant measurements.
- SamReidHughes 8y ago> Optimized does not mean simplified. I didn't say that and was assuming the opposite, so I think you've misread me. Obviously if the faster version is substantially more complicated it's a downside.
- lolc 8y ago"Optimized code" has an established meaning in our field. It's beyond simplified. Don't tell me I'm misreading you when I make you aware of the distinction. I've understood what you wanted to say, albeit with difficulty. Just say "Ah, I meant simplified."
- SamReidHughes 8y agoI never meant simplified by optimized. Simplification is what you do (with O(1) effort) when removing the optimization. When they are the same thing, there is no trade-off to be made.