The DRY Principle: Benefits and Costs with Examples

The DRY Principle: Benefits and Costs with Examples

The DRY principle (Don't Repeat Yourself) is easy to understand but difficult to apply. Should we never repeat our code? What was the true purpose of the principle's authors? Let's decipher what should be DRY in our code, and what should not.