Premature Optimization
- Your code doesn't work, but you're spending the majority of your time debating new implementations details in order to achieve maximal performance.
- You're finally deciding to address your longstanding problem of missing deadlines, but there are so many calendar apps out there, and it's oh-so-hard to decide which one to use. You definitely need to do more research before committing.
- You buy a self-help book and really enjoy it. If you could internalize even half of what that book suggested, you could be an entirely different—and better—person. To collect more advice for self-improvement, you decide to buy another self help book. And wow, that one was maybe even better, so you buy another self-help book. Then another. Congratulations, you're reading more, but otherwise your life hasn't changed.
- New year, new you, and it's time to start working out. You purchase a gym membership, but decide to put together a detailed workout routine so you can maximize the return for the time you spend in the gym. After all, once you're at the gym, you might as well do the best that you can, right? Two weeks later, your routine is solidified, but you've only been to the gym once. The thought of having to do that full routine again dissuades the idea of returning.
- New year, new you, and it's time to start improving your diet. You're no dietician, so you decide to do some research into the diet that would suit you best. Mediterranean? Keto? Vegetarian? Vegan? Intermittent fasting? You put together a spreadsheet comparing which foods and eating times are acceptable under all the most popular diets, only to realize you don't like any preexisting diet and would rather craft your own. You spend a few days doing this. Having crafted your own, you now need to put together a rotating meal schedule based on ten-day cycles because, of course, a seven-day cycle would be far too bland; it would take the fun out of eating, knowing that Tuesday dinner is always fish tacos, and every Friday is grilled chicken wraps; indeed, it's much better to keep yourself on your toes by making the meal you've set for any given day to be hard to remember, regardless of if that comes with a lot more overhead from being completely out of sync with the rest of your life. But it's now been two weeks, and you haven't started dieting.
We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%. – Donald Knuth
It may be the case that your code efficiency improvements may have been critical for the program to be fast enough to reasonably use; that your calendar search may have led you to the only calendar app that works for you; that your self-help book binge continued until one book hit home, convincing you to start actually changing instead of merely fantasizing about it; that after you trudged to the gym a few times, your Ultimate Gym Routine was so effective that the changes you expected to see after months happened in weeks, motivating you to keep working out; or that your ten-day cyclical amalgamated diet was just barely enjoyable enough to stick to long-term, and anything less optimized would've been a failure from the get-go.
The "critical 3%" do exist, but I wouldn't bet on them from the start.