Design Patterns · Middle · Question 34 of 75

Why do people say "duplication is cheaper than the wrong abstraction"?

Explanation

A shared component for two similar screens gradually gets isAdmin, variant, hideFooter… and becomes worse than copies. The AHA principle (Avoid Hasty Abstractions) and the "rule of three": generalize when the repetition has become obvious.

Further reading

Problem with a question

Design Patterns · Middle · question 34

Test yourself

Take the Design Patterns · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz