| < Day Day Up > |
|
Premature Optimization symptoms are:
Most optimizations performed before the final stages of development.
Poor readability and maintainability caused by optimized code.
Unnecessary constraints imposed early in development.
Poor optimizations performed early without the necessary knowledge of the complete application.
The caching of data for optimization purposes too early in development.
To prevent Premature Optimization:
Do not optimize until later in development.
Keep code simple as long as possible.
Use high-level languages.
Use encapsulation and abstraction to prepare for later optimization, providing needed reassurance that optimization can be done later.
Take advantage of editor tools to avoid source code that is hard to read.
To cure Premature Optimization and perform proper optimizations when they are called for:
Do not be afraid to remove optimizations by refactoring to improve readability and maintainability.
Profile often when optimizing.
Test often when optimizing and refactoring.
| < Day Day Up > |
|