Skip to main content
4 events
when toggle format what by license comment
Sep 14, 2023 at 1:18 comment added Flater @Ben: 100% agree and I would take it slightly further that there can sometimes be cases where there is true reusability (things that would actually change in lockstep) but it would make things prohibitively complex to create the reusability abstraction; at which point the better choice is to acknowledge that DRY would apply but still choose to not apply it anyway. It's a pragmatic decision in some scenarios.
Sep 14, 2023 at 1:16 comment added Ben Yeah, even on purely its own terms (i.e. without considering things like performance tradeoffs) DRY isn't absolute. It should be something like "Don't repeat yourself where the repetitions would have to change in lockstep". If two pieces of code happen to be the same right now but the reasons why they would change are likely to be independent, then DRY often makes things worse. (Of course whether things are synchronised or independent itself changes over time as the codebase evolves; it's fundamentally a judgement call, not an objective good)
Sep 14, 2023 at 1:06 history edited Flater CC BY-SA 4.0
added 77 characters in body
Sep 14, 2023 at 1:01 history answered Flater CC BY-SA 4.0