News for hackers. Stuff that matters.
Re:I don’t buy “duplication is cheaper than the wrong abstra... by AnimalMuppet on Tuesday August 29, 2023 @09:17AM (#37307425)
The flip side is, duplication is bad because when you find a bug and fix it, did you fix it everywhere? How many places were there where the bug needed fixed? Are you sure you got them all? It's much easier when there's only one place that you have to fix.
Re:I don’t buy “duplication is cheaper than the wrong abstra... by preommr on Tuesday August 29, 2023 @09:27AM (#37307571)
Ticket closed, case closed.

And I am only half-joking about that. I don't think that effort is that visible and often goes unrewarded. I feel like a lot of managers don't directly, but indirectly use number of tickets closed as a sign of productivity which affects promotions and compensation.

Obviously YMMV, but teams that care about their code quality to such an extent are less likely than places that act as ticket factories.

Re:I don’t buy “duplication is cheaper than the wrong abstra... by mfitton on Tuesday August 29, 2023 @09:24AM (#37307528)
I'm getting shot in the foot by this right now as our team embarks on tackling some long-term tech debt.

The approach we've found that works is health checks and manually looking into cases when we think we've fixed a bug, as it will often point us to a piece of duplicated code we missed that we can wrap into the fold.

Re:I don’t buy “duplication is cheaper than the wrong abstra... by postalrat on Tuesday August 29, 2023 @09:25AM (#37307549)
Or maybe it's a bug in 80% of the cases and not in the other 20%.
Re:I don’t buy “duplication is cheaper than the wrong abstra... by hooverd on Tuesday August 29, 2023 @11:44AM (#37309623)
Maybe that bug in that abstraction was actually load bearing.
Re:I don’t buy “duplication is cheaper than the wrong abstra... by ozim on Tuesday August 29, 2023 @01:51PM (#37311433)
Flip side of the flip side is bad because when you fix the bug in "abstraction" or de-duplicated piece of code: how do you know you did not break something you don't know.

Duplication is easier because once you fix that single place - you are 100% sure you fixed that place and you did not break 10 other places. Maybe you know "by writing unit tests", but when you write unit tests, when you find out you broke something.

Funny story time: had an add/edit popup in system because they looked the same so dev just made it "single thing". Something like 3 months dev1 fixed something -> qa2 found a bug X -> dev2 fixed something -> qa1 found a bug Y -> dev3 fixed something -> qa 3 again found bug X. When I got into code base I noticed that ping-pong because somehow I was only sane person to check git history and I split things up. Something like that happened multiple times in my career