Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
May 3, 2021 01:27 pm GMT

YAGNI & KISS Principles

YAGNI

YAGNI stands for You Aint Gonna Need It. Its a principle from software development methodology of Extreme Programming (XP). This principle says that you should not create features that its not really necessary.

Ron Jeffries, one of the co-founders of the XP, once said:

Always implement things when you actually need them, never when you just foresee that you need them.

It means that you should not implement functionality just because you think that you may need it someday, but implement it just when you really need it.

Benefits of YAGNI principle

1- Avoid spending time with implementations that were not even necessary, and maybe will never be used.

2- With more unnecessary code you write, you may discard write unit tests for them! and then you will start having more issues regarding code quality tools.

Alt Text

KISS Principle

Alt Text

KISS is an acronym for Keep It Simple, Stupid. This principle says about to make your code simple. You should avoid unnecessary complexity. A simple code its easier to maintain and easier to understand.

How to apply KISS principle in code?

You should eliminate duplicated code, remove unnecessary features, also dont use unnecessary variables and methods, follow know standards of code development, also you should separate the responsibilities of your classes and the responsibilities from the layers of the project.

Conclusion

As you can see, The difference between them as you may expect from the header photo, its that YAGNI focus on removing unnecessary functionality and logic, and KISS focus on the complexity.

References

The Pragmatic Programmer David Thomas and Andrew Hunt

Software Architects Handbook Joseph Ingeno

Extreme Programming Installed Ron Jeffries, Ann Anderson, Chet Hendrickson


Original Link: https://dev.to/hassanelseoudy/yagni-kiss-principles-gl2

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To