3 ms·
I don’t like how dang busy it gets. What I do is if I need more than a few args, I accept only an object. And offer only type information in the signature, and
by Waterluvian 1y ago
I don’t like how dang busy it gets. What I do is if I need more than a few args, I accept only an object. And offer only type information in the signature, and resolve default values at the start of the function. It even works nicely if all args are optional.
- game_the0ry 1y ago^^ this I would probably do the same before using kwargs.
- Izkata 1y agoThey are passing "prefix", "ending", and "extraNames" in an object. It's just defined inline in the function and using destructuring so the function can access the keys by name without having to put the object in a variable (and the default values are part of the object destructuring).
- Waterluvian 1y agoYeah but to have half-decent typings you then have to define the entire type, again, in the signature.