Design Patterns · Junior · Question 31 of 75
What does the DRY principle mean?
- ✓Correct answer: Every piece of knowledge in a system should have a single representation
- 2Code should be "dry": no comments or blank lines
- 3You must not reuse other people's code
Explanation
Don't Repeat Yourself is about duplicated knowledge, not just similar lines. If an email validation rule is duplicated in three places, it's easy to miss one when it changes. But prematurely merging code that's similar yet different is harmful too.