Couldn’t agree more. I can agree that premature abstraction is bad. But unnecessarily duplicated code outweighs this by orders of magnitude, in my experience. So stay DRY, and later when you hit that 1 case in 100 where the code needs to diverge, it’s easy enough to copy/paste.
Re:DRY Is a Trade-Off
by throw1234651234 on Friday December 18, 2020 @09:52PM
(#25474548)
This is a very key point - when you re-use, you often need to rename. I actually can't think of a clear example, but this happens ALL the time.
In my experience, the biggest messes I’ve inherited were a result of not being DRY enough: the cases of incidental duplication I’ve run across have been comparatively easy to unwind.