DRY
Don't Repeat Yourself
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."
Related Terms
Function
A function is a reusable recipe. You write the steps once, give it a name, and call it whenever you need those steps done.
KISS (Keep It Simple, Stupid)
Don't overcomplicate things! The simplest solution that works is usually the best one.
Refactoring
Refactoring is improving the internal structure of code WITHOUT changing what it does from the outside.
YAGNI (You Aren't Gonna Need It)
Don't build stuff you don't need right now.