what if DRY is wrong, even in the "single source of truth" sense? So many of our tools for program correctness are, essentially, about overlapping and redundant "sources of truth" -- type definitions, tests, contracts all verify your code's "truth" by duplicating some part of ithttps://twitter.com/rtfeldman/status/1092885754265489408 …
The opposite problem is also bad though. When a piece of code is DRY and shared by 30+ things, and you need to change it for only 3 of those things. Particularly bad if you don't know what calls the function. A change is then potentially breaking for many unknown things.
-
-
I think that underlines the wisdom of keeping functions single-purpose. If there's a variant on that purpose it should be a distinct function.
-
What I mean is that somebody can fix a function, and think that their change is just an implementation detail. If it turns out that it is a breaking change it can cause bugs in the N callers that had different expectations of the function's behaviour.
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.