3 ms·
Right. My quote was the original formulation of DRY as a principle, from The Pragmatic Programmer, and I think it's a good principle. The common (mis?)underst
by dllthomas 3y ago
Right. My quote was the original formulation of DRY as a principle, from The Pragmatic Programmer, and I think it's a good principle.
The common (mis?)understanding of DRY as primarily syntactic both overshoots and undershoots. As many here have discussed, it can lead to combining things you shouldn't (I jokingly call this "Huffman coding"), but it can also fail to recommend combining knowledge when it is represented differently. If I'm saying "there is a button here" in my HTML and in my CSS and in my JS, that's three places for that piece of knowledge even if those three places don't look anything alike. Changing the CSS to "here is what my buttons look like" and the JS to "here is how my buttons behave" would be DRYer.