Skip to content

Comment on When DRY becomes an anti-pattern: Code in Code

Comments

The anti-pattern here is applying DRY to text rather than intents. The identical text may appear in a different source file with a different intent, say a tax calculation for a region. It may very well be that two regions have the same formula, but it's obvious that you shouldn't DRY it.

The example used in the post had no real-world intent. The intent was to blindly apply DRY which doesn't count as one.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.