3 ms·
Premature optimisation, to me, is spending days working out a new algorithm for 5% saving on something that looks inefficient to you but you haven't actually an
by Nursie 7y ago
Premature optimisation, to me, is spending days working out a new algorithm for 5% saving on something that looks inefficient to you but you haven't actually any idea if it's really a problem.
I've never met any of these engineers who think optimization is always wrong.
- mehrdadn 7y agoTo you premature optimization means spending days eking out 5%, but that's not how everyone sees it. Lots of people I've seen would also call e.g. spending 1 hour vs. 30 minutes on a solution that'd be (say) >= 3x faster "premature optimization" due to the fundamental design decisions (not micro-optimization).
- rightbyte 7y agoDogmas are a poison to programming. "No gotos" "You aint gonna need it" "No benefit for the customer" And of course, the topic of this link.
- ahartmetz 7y agoYes. Experts (and salespeople, when asked for a price) know that the answer to almost everything is "it depends" ;)
- Nursie 7y ago> Lots of people I've seen would also call e.g. spending 1 hour vs. 30 minutes on a solution that'd be (say) >= 3x faster "premature optimization" due to the fundamental design decisions (not micro-optimization). And it still might be that way, if the piece you're optimizing isn't performance critical at all, and the effort might be better spent elsewhere. But it might not. The whole thing is a grey area and a good software developer learns to spot when they're spending time on something that doesn't need this effort right now.