DRY Principle (Do not repeat code- write reusable components)
If you are copying and pasting blocks of code from one method, function or block of code to another, then you are in violation of DRY.
Very simply, DRY tells you to move that code into a reusable unit: either into a function or method or macro, or other mechanism relevant to your programming language. If you have places in your codebase where you clearly have very similar code (even with minor variations) then you should be looking to refactor that code to make it DRY.
“Don’t repeat yourself!” == “Don’t write the same code repeatedly”