News for hackers. Stuff that matters.
Re:Code duplication is far cheaper than the wrong abstraction by marcosdumay on Sunday June 21, 2026 @02:04PM (#48621083)
It's sensible if you have strict control of your duplications. You do have strict control of what is duplicated and where, right?

Write everything twice quickly becomes write everything 4 times once a new change appears, just as quickly as it becomes write everything 8 times, and so on.

I'm afraid there's no sensible soundbite developers can follow blindly.

Re:Code duplication is far cheaper than the wrong abstraction by coldtea on Sunday June 21, 2026 @02:24PM (#48621274)
>Write everything twice quickly becomes write everything 4 times once a new change appears, just as quickly as it becomes write everything 8 times, and so on.

That's a good problem to have. Getting to 4 or 8 or 12, and then pruning it to 1 or maybe 2 or 3 clearly different cases, is better than shoehorning multiple cases into the wrong abstraction, having everything that speaks with them coupled to that and dancing around their assumptions, and then having to untangle that.

Duplicated code is by definition LESS coupled.

Re:Code duplication is far cheaper than the wrong abstraction by tcfhgj on Tuesday June 23, 2026 @09:36PM (#48654076)
The coupling is just invisible and easy to forget