Re:DRY Is a Trade-Off
by Groxx on Friday December 18, 2020 @06:02PM
(#25473163)
My boundary on DRYing has settled on "when it's semantically the same code".
Code that looks the same but is used for different purposes / has different meaning? Keep it separate. They may diverge in the future.
Code that truly means the same thing, but may or may not look the same? DRY it up, any variation is probably unintended and will surprise people later when A doesn't behave like B.
Code that looks the same but is used for different purposes / has different meaning? Keep it separate. They may diverge in the future.
Code that truly means the same thing, but may or may not look the same? DRY it up, any variation is probably unintended and will surprise people later when A doesn't behave like B.