What does DRY mean?

DRY stands for Don't Repeat Yourself.

📚

Principle Definition

DRY stands for 'Don't Repeat Yourself' and is a software development principle that emphasizes reducing repetitive patterns and duplicated code in favor of modular and referable code.

👨‍💻

Origin

Coined by Andy Hunt and Dave Thomas in 'The Pragmatic Programmer', DRY aims to ensure that each piece of knowledge has a single, unambiguous representation within a system.

⚙️

Importance

Writing DRY code is essential for maintainability, scalability, and to avoid the opposite, WET code ('Write Everything Twice').

🔍

Rule of Three

A good general rule for DRY code is the 'Rule of Three', which suggests abstracting code into a reusable unit the third time a certain pattern is encountered.