Login

Log in with one your accounts

Contribution

We are happy you want to contribute to DXKB. Please choose your preferred way

All Articles
Mar 03, 20212 min read

YAGNI Principle

YAGNI stands for You aren't gonna need it. This principle means you should implement only required functionalities.

What Is YAGNI Principle

YAGNI is an extreme programming principle (XP) which states that you must not implement features that you assume as significant in the future.

YAGNI PrincipleSource: YAGNI Principle

Ready to put this knowledge into action?

Visit our website and learn how DX Heroes can help your business succeed.

Why You Might Want YAGNI Principle

This principle helps you to focus on the required features and not add unnecessary functionality. As a programmer, you sometimes try to foresee the future. You presume that additional requirements might come up later in development. Then, there is an assumption that the present code should encapsulate this. A lot of effort and time is involved in implementing new functionalities. Implementing additional functionalities can lead to schedule slippage, code complexity apart from unnecessary code. These features need to be maintained and may even need to be modified in the future. There are chances that the functionalities may become obsolete and may never be needed.

Problems YAGNI Principle Helps to Solve

How to Implement YAGNI Principle

Clarity on requirements and deadlines

You need to have a clear picture of the requirements and targets to prevent deviations from the required design.

Analysis

Ask yourself whether you will need these features soon or if you are just assuming they might be important.

Planning

You should plan for the effort required and if it will be better to do it at present or leave it for later. This will also include the time to test and review the extra code.

Common Pitfalls

  • Overenthusiasm for providing the best and lasting solutions leads to adding extra features.
  • Coding habits of programmers make them think ahead of time and include extra functionalities.

Resources

Was the article helpful?

Want to write for DXKB?

Feel free to contribute. People from DXKB community will be more than happy.

Contribution

We are happy you want to contribute to DXKB. Please choose your preferred way