jargon

Design patterns·The named ways it goes wrong

the call reads createUser(name, true, false) and you have to open the definition to find out what either means.

Boolean trap

Also calledboolean parameter, flag argument

A boolean parameter that makes a call site unreadable and usually indicates a function doing two different things. The immediate fix is a named constant or an enum; the better one is often two functions with names, since the boolean is generally selecting between two behaviours rather than configuring one. It is the most frequently cited example of connascence of position and meaning at once.

Commonly confused with