Comment

Comment by haswell

One of the #1 issues I’ve seen with DRY over the years seems to stem from a misunderstanding of what it means.

DRY is not just about code duplication, it’s about information/knowledge duplication, and code happens to be one representation of information.

Hyper focusing on code duplication quickly gets into premature optimization territory, and can result in DRYing things that don’t make sense. Focusing on information duplication leaves some leeway for the code and helps identify which parts of the code actually need DRY.

The difference is important, and later editions of the Pragmatic Programmer call this out specifically. But the concept of DRY often gets a bit twisted in my experience.

parent haswell 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton