logoalt Hacker News

Thaxlltoday at 5:50 PM1 replyview on HN

So you centralize 3 liners?


Replies

dofmtoday at 6:16 PM

I said "beyond a de minimis threshold".

But in one of the scenarios I mention earlier, I earned a chunk of money once fixing an issue that emerged in a subcontractor's four or five line duplication that had ended up rippled through a long-lived codebase. A ground truth (MySQL version) changed, and the pattern broke everywhere, including places where it had evolved.

So I tend towards thinking, yes, any three-line pattern that is likely to appear everywhere should, perhaps, be centralised.

It's certainly worthy of serious consideration. Usually pretty easy to maintain the surface of such an abstraction.