Don’t repeat yourself is a principle of software development aimed at reducing repetition of code and replace it with abstractions.
DRY principle says:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
If you’ve duplicated a bit of code in many places, the DRY principle tells you to extract the duplication into a single common method and then invoke this new method in place of the old code.

