Briefle words · Code & architecture
Magic string
A raw text value typed directly into the code whose meaning, and correct spelling, is only known by convention.
Say it to an AI
TypeScript helpers for helpdesk tickets. Model status as a TicketStatus enum (open, pending, resolved, closed) as the single source of truth, type Ticket.status with it, and never compare or assign magic strings. canReply(ticket) and resolve(ticket), both pure.
How an expert would brief the stronger version of “Ticket status”.
See it
Try it as a puzzle →Shared helpers a customer-support helpdesk uses to check and change a ticket's status.
Why: B compares against "closed" and assigns "Resolved"; the two don't even agree on capitalization.
Related words
Room 5 · APIs & data
Learn “Magic string” in a five-minute lesson