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.
Why: B takes 'useSms: boolean' and 'urgent: boolean', so callers write 'sendReminder(user, true, true)'.
Related words
Room 3 · Functions & structure
Learn “Flag argument” in a five-minute lesson