You Ain't Gonna Need It (YAGNI)
suggest changeIf you can say “YAGNI” (you ain’t gonna need it) about a feature, do not implement it. A lot of development time can be saved by focusing on simplicity. Implementing such features anyway can lead to problems:
Problems
Overengineering
If a product is more complicated than it has to be, it is over-engineered. Usually these “not yet used” features will never be used in the way they were written and have to be refactored if they ever get used. Premature optimisations, especially performance optimisations, often lead to design decisions which will be proved wrong in the future.
Code Bloat
Code bloat means unnecessarily complicated code. This can occur for example by abstraction, redundancy or incorrect application of design patterns. The code base becomes difficult to understand, confusing and expensive to maintain.
Feature Creep
Feature Creep refers to adding new features that go beyond the core functionality of the product and lead to an unnecessarily high complexity of the product.
Long development time
The time which could be used to develop necessary features is spent developing unnecessary features. The product takes longer to deliver.
Solutions
KISS - Keep it simple, stupid
According to KISS, most systems work best if they are designed simply. Simplicity should be a primary design goal to reduce complexity. It can be achieved by following the “Single Responsibility Principle” for example.
YAGNI – You Ain’t Gonna Need It
Less is more. Think about every feature: is it really needed? If you can think of any way that it’s YAGNI, leave it out. It’s better to develop it when it’s needed.
Continuous Refactoring
The product is being improved steadily. With refactoring, we can make sure that the product is being done according to best practice and does not degenerate into a patchwork.