4 ms·
Nim (like Python) has keyword argument calling that softens the need to remember the out-of-n! order of parameters (by either author|reader). I.e. you can say
by cb321 6y ago
Nim (like Python) has keyword argument calling that softens the need to remember the out-of-n! order of parameters (by either author|reader). I.e. you can say at the call site `myAPIcall(foo=1, bar="hi")` even if the definition is `proc myAPIcall(bar: string, foo: int)`.
Arguably, this puts more pressure on code completion systems figuring out parameter names. So, I am not really disagreeing with @rob74 -- just adding some color related to this specific programming language.
I've always been a bit mystified that named parameter calling was not far more popular. Its use in programming languages seems quantitatively rare, but the upsides seem far more valuable than any downsides. Its use for either short or long options when calling commands has been a very strong de facto standard since, well, the dawn of commands (there are always exceptions, of course).