Just like my post from last week, YAGNI is another acronym in computer science. It’s an acronym for “You Aren’t Gonna Need It”. Which translate to only having features added when they are required. It’s another type of principle that is heavily followed in computer science. This is a large part of development since it trims away any excess and inefficient part of the program.
The YAGNI principle tells you to mainly focus on current tasks. This however does not mean you cannot work on future steps but if it’s something that doesn’t need to be done currently, then you shouldn’t spend time doing it now since you can be working on something that will be more valuable now. A real-world example that I found can be that a client orders a kayak but is given a yacht. They both float on the water, but the yacht is like a luxury house on the water, where as the kayak is a simple vessel used to travel on water. In this case the yacht isn’t necessary as the client only wanted to travel or even just float on the water. This is considered “over-engineering”. This is a term that can be define as making something more complex instead of simplifying things
There are many advantages to YAGNI. First, you will be saving time which also means you are saving money. Without having complex code, it makes it easier for others to understand the code. Without all the unnecessary coding, the code itself is better quality and allows developers to focus more on what the code is about instead of having to figure out what everything does. Following the YAGNI principle allows developers to not waste time on creating extraneous elements that may not be necessary or slow the development process.
The reason why I chose to write about the YAGNI principle is because it is a part of our curriculum. Since I am planning to become a developer, I need to learn the different principles when it comes to programming. Learning about the YAGNI principle will help me become a better programmer as I will know to only work on the current tasks and not try to implement more complex code that will not be used until a later date or when it is necessary.
Here are some blogs I recommend to those who want to learn more about the YAGNI principle.
https://codibly.com/news-insights/yagni-how-to-do-things-when-you-actually-need-them-to-be-done/
https://whatis.techtarget.com/definition/You-arent-gonna-need-it
From the blog CS@Worcester – Michael's Developer Blog by michaelchaau and used with permission of the author. All other rights reserved by the author.