Skip to main content

Timeline for Illusory code duplication

Current License: CC BY-SA 3.0

6 events
when toggle format what by license comment
Oct 18, 2015 at 12:28 comment added Eric Also essential duplication and accidental duplication, see An Accidental Doppelgänger in Ruby and I DRY-ed Up My Code and Now It’s Hard to Work With. What Happened?. Accidental duplicates also occur on both sides of a context boundary. Summary: only merge duplicates if it makes sense for their clients for these dependencies to be modified simultaneously.
Oct 16, 2015 at 21:20 comment added Ben Aaronson @gnasher729 Yep, that is the point. If two pieces of code have duplication of knowledge, then you'd expect that when one needs to change, then the other will need to change too, leading to the problem you describe. If they have incidental duplication, then when one needs to change, the other may well need to stay the same. In that case if you've extracted a common method (or whatever), you now have a different problem to deal with
Oct 16, 2015 at 21:14 comment added gnasher729 I thought the focus of DRY was to ensure that there are no two bits of code that should behave identical but don't. The problem isn't the doubled work because code changes have to be applied twice, the real problem is when a code change needs to be applied twice but isn't.
Oct 16, 2015 at 19:26 comment added user82096 This is quite helpful.
Oct 16, 2015 at 17:52 comment added Matthieu M. This! The focus of DRY is avoiding duplicate changes.
Oct 16, 2015 at 15:50 history answered Ben Aaronson CC BY-SA 3.0