YAGNI (You Aren’t Gonna Need It)
Overview¶
Be mindful of adding that feature or that library in your code. Before you add something new, ask yourself "Am I really gonna need this?" Don't add anything unnecessary.
Best Practices¶
- Don't Speculate on Future Requirements. You should not write "design ahead" or "code ahead" for future needs because those requirements haven't been fully developed yet.
- Design for Replaceability, Not Just Expansion. The best way to prepare for the future is to make your currently required code as clear and straightforward as possible so it is easy to throw out and replace when needs change.
- Apply the Pareto Principle (80/20 Rule). Focus on the 20% of features that will provide 80% of the system's benefit or revenue.
YAGNI (You Aren’t Gonna Need It)