7

The important of DRY, KISS, and YAGNI in programming.

 2 years ago
source link: https://dev.to/alfredbis29/the-important-of-dry-kiss-and-yagni-in-programming-4akf
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Cover image for The important of DRY, KISS, and YAGNI in programming.

The important of DRY, KISS, and YAGNI in programming.

In this article, I'll go over what DRY, KISS, and YAGNI mean, how to utilize them in best practices to build clean code, and why it's vital to know about them.

Why is important to make clean code ?

Writing clean code is important because it allows you to clearly communicate with the next person who works with what you've written. Being able to return to previously written code and understand what it does is key, especially in the software development world, Where we always need to learn from each others.

There are some principles that programmers have embraced, independent of the language you are working in.

Here are the best ones:

  • DRY: Don't repeat yourself! It simply means you should try to avoid having duplicated code. Instead, you should reuse your code when possible. Every piece of knowledge must have a single, unambiguous, authoritative representation within a system (Andrew Hunt & David Thomas, "The Pragmatic Programmer").
  • KISS: Keep It Simple, Stupid. No further explanation is needed! Try to avoid unnecessary complexity, don't over-engineer your code. A simple, small, and easy-to understand code base is easier to maintain and scale.
  • YAGNI: You Aren't Gonna Need It. Don't add anything you don't strictly need. Try to avoid the temptation of adding the most trendy technologies just because you think they may be useful in the future. Add things gradually, when they are really needed .

Additional materials

These are all optional, but if you're interested in exploring this topic further, here are some resources to help you. Any exploration here should be done outside program time.

higher education program by Martin Clean Code A Handbook of Agile Software


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK