3 ms·
DRY is a problem because it's so catchy and seems so self-explanatory. The original formulation of DRY spoke in terms of information. Any piece of information
by dllthomas 10y ago
DRY is a problem because it's so catchy and seems so self-explanatory.
The original formulation of DRY spoke in terms of information. Any piece of information should exist in exactly one place in your code. As I've said before, modulo some caveats related to double-entry bookkeeping, this seems exactly right. An inveighing against anything that looks repetitive is not.
The goal is not compression, it's ease of understanding and ease of making correct modifications.
I've started using "Huffman coding" to refer to the practice of misapplying DRY by deduplicating superficial similarity rather than information content.
- zachrose 10y agoThis is a cogent way to frame the acronym. There are times when repeating yourself is just accidental. I might have the same middle name as a coworker. Do we actually "share" that middle name? That depends on who's asking, or what system you're trying to build. But probably not.