Duplication Over Abstraction

It’s better to favor duplication over the wrong abstraction. The wrong abstraction starts out as a way to remove duplication and then gets altered over time to handle more and more conditions to the point where it’s unique to all the callers.

When this happens, the best solution is to ‘go backwards’ and inline the relevant code to the callers (with their respective special cases).

Read The Wrong Abstraction by Sandi Metz.

See also: