News for hackers. Stuff that matters.
Re:Good Software Development Habits by charles_f on Sunday November 17, 2024 @02:16PM (#42166278)
That's not entirely true. The difference between intentional and accidental repetition is that the first occurs because the rule is the same in both repetitions, and should be the same ; whereas the second happens to be the same for now. In not repeating yourself in the second case you actually risk changing an operation that should remain the same, as a side effect of changing the common function to alter the behaviour of the first.

That's why DRY is a smell (indicates that something might be wrong) and not a rule.

There are no comments on this comment yet.