Another alternative to DRY is WET: Write Everything Twice. Only make an abstraction on the third code repetition.
I started adopting this a few years ago and it’s surprising how seldom I hit three identical, non-trivial code repeats. Saved a lot of hours over the years not making a seemingly prudent generic layer.
Nothing is more frustrating than having a colleague who never gets things done and are constantly writing abstractions for days. Like bro, you ain't gonna need this - I know you're flexing your abstract methods but it is fucking useless if it will never have more than one overrides.
I don’t understand this argument. It’s trivial to de-duplicate an abstraction by just inlining the code. How is that less efficient than duplicating code? At least in the meantime you get the benefit of shared code changes.
I started adopting this a few years ago and it’s surprising how seldom I hit three identical, non-trivial code repeats. Saved a lot of hours over the years not making a seemingly prudent generic layer.