Hacker News new | ask | show | jobs
by arghbleargh 3945 days ago
I think the article agrees with you, but another point it makes implicitly is that programmer A is also on the hook for creating a brittle abstraction. The article is specifically warning against the temptation to deduplicate things for its own sake, without having in mind a good abstraction that describes the shared functionality implemented by the duplicated code.
1 comments

You make a good point, though if A could not have anticipated the future changes, his actions may have been justified at the time. One justification that often applies to deduplication is to reduce the chance that future changes would miss one of the cases, but that only applies so long as the changes don't break the abstraction.

Avoiding brittleness is worthwhile up to a point, but overly-general abstractions often carry a cost in unnecessary complexity. From my own experience, I can think of three examples where generic programming, a container framework, and a DSL were used respectively, to create inordinately complex solutions having degrees of flexibility that would never be useful.