Re:On DRY and the cost of wrongful abstractions
by dllthomas on Monday September 19, 2016 @12:16AM
(#12528851)
> Interestingly this can be "anti-DRY"
Which is funny, because as originally coined, it is exactly "DRY".
"Every piece of knowledge must have a single, unambiguous, authoritative representation within a system".
This can be true for logic as well. If you have a very specific conditional it can help to put it into a function so that it's purpose is clear, especially so if it's a piece of business logic that might change. Interestingly this can be "anti-DRY" as well because you might have the same logic duplicated in different places, but the fact that they are the same is a coincidence, and you want them to change depending on their own requirements.