You Ain't Gonna Need It
From Wikipedia, the free encyclopedia
In software engineering, YAGNI, short for 'You Ain't Gonna Need It', is a reminder for programmers that one should never add functionality until it is necessary. The temptation to write code that is not necessary at the moment, but is perceived to be necessary in the future, has some overlooked disadvantages:
- The time spent is taken from necessary functionality.
- The new features must be debugged, documented, and supported.
- Any new feature imposes constraints on what can be done in the future, so an unnecessary feature now may prevent implementing a necessary feature later.
- Until the feature is actually needed it is not possible to define what it should do, or to test it. This often results in such features not working right even if they eventually are needed.
- It leads to code bloat; the software becomes larger and more complicated while providing no more functionality.
- Unless there are specifications and some kind of revision control, the feature will never be known to programmers who could make use of it.
- Adding the new feature will inevitably suggest other new features. The result is a snowball effect which can consume unlimited time and resources for no benefit.