Discussion Thread: DIP 1030--Named Arguments--Final Review
Walter Bright
newshound2 at digitalmars.com
Sat May 16 20:57:06 UTC 2020
On 5/15/2020 12:56 PM, Jonathan M Davis wrote:
> I don't want to have yet more stuff added to a function's API which I then
> have to worry about whether I can change without breaking existing code. We
> already have enough such problems to worry about without adding more. And I
> don't want to have to deal with bikeshedding over parameter names like we
> too often have to deal with with function names and type names.
I almost never change a parameter name. I also can't see myself using named
parameters very often. Nobody says anyone has to used them.
> From the
> perspective of someone writing libraries for others to use, I see named
> arguments as nothing but trouble. And as a user, I don't see them as adding
> any real benefit except in cases where functions have too many parameters
> anyway and probably should have been designed differently.
I'd like to have them just so we can get rid of that Flag!"Name".yes template
abomination:
https://dlang.org/phobos/std_typecons.html#Flag
> Given that you're the one writing this DIP and that Atila has been in favor
> of named arguments for years, I expect that I'm going to be stuck dealing
> with named arguments in D at some point here,
Probably true.
> but I'm sure not happy about the idea.
Sorry about that. But I suspect you'll like it better than that awful `struct Yes`:
https://dlang.org/phobos/std_typecons.html#Yes
More information about the Digitalmars-d
mailing list