What is YAGNI?
YAGNI – You aren’t gonna need it is an Extreme Programming (XP) key practice that’s states: “Always implement things when you actually need them, never when you just foresee that you need them.”As it stated then programmer should not add functionality until it is proven to be absolutely necessary
YAGNI Principle always recommends programmers to build the easiest solution to today’s problems. Even if you are sure you will need the feature, moreover, do not run it now. Mostly, it’ll alter in either:
- You won’t need it after all, or
- What you really need is different from what you originally thought.
Why YAGNI Principle is mostly relevant in Software Development Lifecycle than others?
In Software Development when software developers start implementing features they always go into practices known as FEATURE CREEP. Software developers always try to add or improve features regardless of whether they are not requested by users. For example, developers may try to add authentication to the form without first completing CRUD in the database.
Alternatively, following YAGNI in the configuration life cycle enables developers to implement features that will only be relevant for the first duplicate or demo and other future features that will work as a new version or update of software developed as recommended by users.
YAGNI Principle is safe, if …
The YAGNI principle, alone, may not be secure. Software developers can set up an early algorithm on the system and then copy-paste it all over, so when it goes wrong they spend a lot of effort fixing it. With this process in coding, YAGNI is very dangerous and may not be the best idea.
But when the developers set the quality of the design, the quality of the code, and the quality of the test, YAGNI is completely safe, as every future risk is excluded by simple design rules, and it will be easy to find and fix if it goes wrong.
Benefits of YAGNI:
- With a simple answer you can say the biggest benefit of the YAGNI Principle is to avoid unnecessary development.
Main reasons to practice YAGNI
1. It saves time as you avoid writing code that may not make sense later.
2. Your current code is better because you avoid guessing which can be bad
For two main reasons for practice, they ensure:
• That deadlines are available quickly,
• Customer satisfaction due to visible and frequent changes according to their needs or details,
• The best quality of code ordered by the fact that developers focus on small tasks (those that are currently very important),
• The code can be extended more and more (allows for updated versions),
• Reduced number of adjustments required,
• That the error is easy to fix.
REFERENCE: –
https://deviq.com/principles/yagni
From the blog CS@Worcester – THE SOLID by isaacstephencs and used with permission of the author. All other rights reserved by the author.