Briefle
LearnGlossaryPricing

Briefle words · Code & architecture

Flag argument

A true/false parameter that switches a function between different behaviors, which makes calls hard to read and often hides two functions in one.

Say it to an AI

TypeScript sendReminder(user, options) for overdue invoices. No boolean flag arguments: take an options object with channel: "email" | "sms" and an optional urgent flag defaulting to false, so call sites are self-documenting.

How an expert would brief the stronger version of “Invoice reminders”.

See it

Try it as a puzzle →

An AI assistant hands back a helper that nudges customers of an invoicing SaaS about unpaid bills.

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

Why: B takes 'useSms: boolean' and 'urgent: boolean', so callers write 'sendReminder(user, true, true)'.

Related words

  • Intention-revealing name
  • Magic number
  • Single responsibility principle
  • Boolean
  • Predicate
  • is/has/can prefix
  • Abbreviation
  • Verb-noun naming

Room 3 · Functions & structure

Learn “Flag argument” in a five-minute lesson

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