QUESTION
I've been here for nearly a month and it seems that people have a tendency to be eager to use the "Premature Optimization is the root of all evil" argument as soon as someone mentions efficiency.
What is really a premature optimization? What is the difference between what is essentially writing a well designed system, or using certain methods and premature optimizations?
Certain aspects that I feel should be interesting topics within this question:
- In what way does the optimization influence code complexity?
- How does the optimization influence development time/cost?
- Does the optimization emphasize further understanding of the platform(if applicable)?
- Is the optimization abstractable?
- How does the optimization influence design?
- Are "general solutions" the better choice instead of specific solutions for a problem because the specific solution is an optimization?
EDIT / update: Found these two links that are very interesting regarding what a premature optimization really is:
http://smallwig.blogspot.com/2008/04/smallwig-theory-of-optimization.html
http://www.acm.org/ubiquity/views/v7i24_fallacy.html
ANSWER
Any optimisation that involves an associated pessimisation (i.e readability, maintainability) without a clear benefit, demonstrable via testing/profiling.
Tweet