3 ms·
Think the issue is not with named parameters per se, but with mixing domain logic = there are two different user creation flows, that should be doing two differ
by eithed 5mo ago
Think the issue is not with named parameters per se, but with mixing domain logic = there are two different user creation flows, that should be doing two different things (or mostly different things), but are guarded with boolean flag.
As author points out: "So I’ll usually just make it explicit:
createAdminUser(user);
createRegularUser(user);
Now there’s not much left to interpret. To be fair, this isn’t always bad. Sometimes this is completely fine:
toggleMenu(true);
That’s clear enough. This tends to work when:
- the meaning is obvious
- the function is small and local
- there’s only one flag
"