Briefle
LearnGlossaryPricing

Briefle words · Code & architecture

DRY

Also called Don't Repeat Yourself

The principle that each piece of logic should be written in exactly one place, not copied around.

Say it to an AI

TypeScript monthlyPrice and yearlyPrice (yearly = 10 months) for a plan, including VAT. Keep it DRY: both call one private helper, withVat(amount, country), that looks the rate up in a VAT_RATES map and rounds to cents, so no tax logic is duplicated.

How an expert would brief the stronger version of “Subscription prices”.

See it

Try it as a puzzle →

Pricing code that shows monthly and yearly plan prices, with VAT, on a video streaming service.

Study A · the weaker one
Study B · the stronger one

Why: B's VAT lookup and rounding exist only in 'withVat'; A copies the rate lookup, the multiply and 'Math.round(price * 100) / 100' twice.

Related words

  • Identifier
  • Intention-revealing name
  • Guard clause
  • Happy path
  • Swallowed exception
  • Structured logging
  • Conventional Commits
  • Atomic commit

Room 1 · Essentials

Learn “DRY” in a five-minute lesson

Start free
AI can build almost anything. The bottleneck is saying what you want.
WordsPricingTermsPrivacyRefundsContact
© 2026 Briefle