Replace a flag argument with clearer public behavior without breaking callers.
Boolean blindness sendReceipt(order, true) works, but it does not tell the reader what true means. The bug risk is not syntax; it is invisible intention at the call site. Catalog move Remove Flag Argument Replace a mode flag with explicit functions whose names describe the behavior the caller wants. Flag sendReceipt(order, true) Call sites read like behavior, not branch selectors. Public APIs should reveal intent at the place they are used. 01 Name 02 Migrate 03 Clean First decision The current flag controls customer copy versus internal resend.
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in