Skip to content

Comment on Rant: The DRY Principle Is Bad Advice

Comments

DRY is simple and should not be thought too much off.

Don't Repeat Yourself. Too many developers look at this principle with refatoring in mind, a lot more than it should be.

If you have duplicate code, and by duplicate, i mean exact copy, then this principle applies. A 90% duplication is not a copy. It's close, but it's not a copy.

Abstractions often come with a much higher cost than duplication. It's much easier to get your abstractions wrong than it is to keep things stupid and repetitive.

Time is your friend here. Don't ever start abstracing, introduce it slowly and a small bit at a time.

AboutSource Built by g1lg1l

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