Comment

Comment by BeetleB

The first thing I did when I read this was come to the HN comments and search for people complaining about DRY:

https://news.ycombinator.com/item?id=22022599

https://news.ycombinator.com/item?id=22022842

https://news.ycombinator.com/item?id=22022896

https://news.ycombinator.com/item?id=22022836

The author of this piece was not engaging in a DRY activity even if he thought he was. He (perhaps unwittingly) admits to it himself:

> My code traded the ability to change requirements for reduced duplication, and it was not a good trade.

The acronym DRY was coined in The Pragmatic Programmer, and the author of that book makes it clear that DRY is about not repeating requirements in code. You definitely don't want to deduplicate similar code if it involves multiple requirements because then you entangle yourself, which is what the author of this piece did.

parent BeetleB 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton