someone said :
‘ They say good programmer writes 100 lines of code per day but a great one deletes 50. Do you agree? Let’s become the latter by following the Don’t Repeat Yourself principle, because the best code is no code at all ‘.
when I made my first search about DRY I find this :
Don’t repeat yourself is a principle of software development aimed at reducing repetition of software patterns, replacing it with abstractions or using data normalization to avoid redundancy. The DRY principle is stated as “Every piece of knowledge must have a single, unambiguous, authoritative representation within a system”.
So what this mean? and how can we use it?
in the Article, I try to write a simple explication.
Don’t repeat yourself principle ( DRY ) has been formulated by Andy Hunt and Dave Thomas in their book The Pragmatic Programmer.
DRY is a principle we should use every day in our code, because it makes it simple to read and understand, by never write a two function that will do the same stuff.
Before you write your code, you should think two or three steep forward, this way will help you get the big image for you All code, and in this way will find yourself apply DRY.
DRY is one the principal of CLEAN CODE,
make sure to always search for improving your code, until it is easy to read by others because one day you will be the other.