Re:The 'premature optimization is evil' myth (2010)
by carussell on Monday March 14, 2016 @04:18PM
(#11285277)
Examples on either side abound.
I know I've certainly done enough optimizations that left the code clearer and shorter (despite often being more verbose with naming), while being more performant due to shedding whatever messy, tortured approach was in use before. Enough small gains like this have come out of code where I was the original author that it isn't a case of conceit.
Clear and simple code can frequently beat clever code, regardless of which metric you choose to apply from the "performance or understandability" bag.
I know I've certainly done enough optimizations that left the code clearer and shorter (despite often being more verbose with naming), while being more performant due to shedding whatever messy, tortured approach was in use before. Enough small gains like this have come out of code where I was the original author that it isn't a case of conceit.
Clear and simple code can frequently beat clever code, regardless of which metric you choose to apply from the "performance or understandability" bag.