Briefle words · Code & architecture
Named arguments
Passing inputs with their names attached so the call reads on its own and order doesn't matter.
Say it to an AI
TypeScript helper createShipment that books a parcel via carrier.book. Take a single parameter object (a ShipmentRequest type) rather than a long parameter list, so call sites read as named arguments and the two booleans can't be swapped.
How an expert would brief the stronger version of “Book a shipment”.
See it
Try it as a puzzle →A warehouse app's helper that books a parcel with the carrier after an order is packed.
Why: A's call says 'insured: true' and 'signatureRequired: false' instead of a bare 'true, false'.
Related words
Room 3 · Functions & structure
Learn “Named arguments” in a five-minute lesson