Skip to content

DRY

Don't Repeat Yourself

Easy — everyone uses thisArchitecture

ELI5 — The Vibe Check

If you find yourself copy-pasting the same code in multiple places, STOP. Make it a reusable function instead. That way, when you need to change it, you only change it once. The opposite of DRY is WET (Write Everything Twice).

Real Talk

DRY (Don't Repeat Yourself) is a software development principle that states every piece of knowledge should have a single, authoritative representation. Violations lead to maintenance burden and inconsistency when changes are needed.

Show Me The Code

// WET (bad):
const tax1 = price1 * 0.25
const tax2 = price2 * 0.25

// DRY (good):
const calcTax = (price) => price * TAX_RATE
const tax1 = calcTax(price1)
const tax2 = calcTax(price2)

When You'll Hear This

"This is not DRY — the same logic is in three places." / "DRY it up with a shared utility function."

Made with passive-aggressive love by manoga.digital. Powered by Claude.