DEV Community

loading...

YAGNI Principle in 100 seconds

Richard Wynn
👋 Hi, I'm Richard Wynn, a Senior Full-stack Software Engineer with a joy of Coding, Writing and Sharing knowledge
・2 min read

💡 What does YAGNI stand for?

YAGNI stands for You Ain’t Gonna Need It. It’s a principle from software development methodology of Extreme Programming (XP). This principle says that you should not create features that it's not really necessary.
Alt Text

This principle is similar to the KISS principle, once that both of them aim for a simpler solution. The difference between them is that YAGNI focus on removing unnecessary functionality and logic, and KISS focus on the complexity.

Why YAGNI?

  • Any work that's only used for a feature that's needed tomorrow, means losing effort from features that need to be done for the current iteration.
  • Creeping featurism leads to code bloat; the software will becomes larger and much more complicated.

Quotes

  • Always implement things when you actually need them, never when you just foresee that you need them. (Ron Jeffries, one of the co-founders of the XP)

📝 When not to practice YAGNI

  • Learning something new: Evaluate a new technology exclusively to gain the time back later and minimize the risk of losing more time by making the wrong decision.
  • Current design decisions based on future needs: Don't sabotage your efforts because you think they violate YANGI. Instead, make the future-proof design decision, but only implement enough to fulfill the current need.
  • Abstracting external dependencies: Take time to astract these dependencies will avoid rework and decrease the complexity.
  • Testing, Security, Scale, and Business Requirements: YAGNI is not a free-pass on writing tests, secure code, considering scale, or business requirements. Alt Text

📱 Keep in Touch

If you like this article, don't forget to follow and stay in touch with my latest ones in the future by following me via:

📰 Other Programming Principles

Be interested? 😃 You can visit the links below read my other posts in my programming principles series

Discussion (0)