News for hackers. Stuff that matters.
Re:I don’t buy “duplication is cheaper than the wrong abstra... by dllthomas on Wednesday August 30, 2023 @08:42PM (#37331094)
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.

There are no comments on this comment yet.