Re:DRY is an over-rated programming principle?
by CTmystery on Thursday July 07, 2022 @08:55AM
(#32013457)
You're almost there, IMO. This internet stranger encourages you to ditch the rule of DRYing based on the number of repetitions at all, and instead think of DRYing based on what deserves to change to together. Sometimes a single repetition in code deserves to be DRY. Sometimes 10 repetitions don't deserve to be DRY.
[ Parent
| on HN ]
Re:DRY is an over-rated programming principle?
by ryathal on Thursday July 07, 2022 @09:11AM
(#32013635)
Isn't that playing a little loose with definitions? if you have 10 "repetitions" that don't need to change simultaneously they aren't really repetitions in the first place. Just because a dumb analyzer says you have a 10 line block of identical code in 10 places doesn't mean it's actually identical.
Re:DRY is an over-rated programming principle?
by sirmarksalot on Thursday July 07, 2022 @04:54PM
(#32019260)
You're restating the article's point. Naive DRY says make the dumb analyzer happy by abstracting out the coincidental similarities. If you work in a place that recognizes that this can be a red herring, then great, but a lot of developers and teams don't make room for that nuance. That is what the article is arguing against.