Ultimately I think I’d bias towards readability vs the marginal perf increase though.
I feel like a goal with good code is localizing understanding even if it occasionally duplicates something like a parameter name.
const isAdmin = true; . . . createUser(user, isAdmin, sendWelcomeEmail)
> And I’ve seen real calls like this in production code: > updateSettings(user, true, false, true, false)
Really? He wants named parameters on all function calls cos he's got a memory like a sieve? This is a long solved problem to me
PaulKeeble•1h ago
I don't mind the object approach used here but its quite verbose in comparison even in Javascript. Having to name the variable and set whether its true or false is a lot more than needs to be done. Booleans in general have quite poor readibility and maintenance especially if a third possibility arrives.