DIP 1019--Named Arguments Lite--Community Review Round 1

12345swordy alexanderheistermann at gmail.com
Sun Feb 17 18:57:26 UTC 2019


On Sunday, 17 February 2019 at 18:00:46 UTC, Rubn wrote:
> On Sunday, 17 February 2019 at 17:48:33 UTC, 12345swordy wrote:
>> On Sunday, 17 February 2019 at 17:09:57 UTC, Yuxuan Shui wrote:
>>> And they have the problem that the name of the parameter 
>>> becomes part of the API. This is something this DIP tries to 
>>> solve.
>> A better solution would be allowing nameless parameters 
>> functions and refer the parameters by index.
>>
>> -Alex
>
> That'd be worse, it'd make code less readable, the opposite of 
> what named parameters are for.

That is only if you are so worried about "parameter name becomes 
part of the API", which such concerns should be the exception, 
not the norm. I have never ever encounter anyone in the c# 
community that worry about named parameter becomes part of the 
API, when named parameters are introduced.

Client can simply use find and replace if the library they using 
change their parameter name. It is not a deal breaker as the DIP 
making out to be.

Regardless, my objections still stand regarding @named attribute 
and I can not tell other people with a straight face that in 
order to use named parameters they have to use @named attribute 
without expecting them to look at me like "Are you insane?"

I do not want D design to be worst, because of the "avoiding 
breaking code at all cost" mentality. That is what C++ is for.


More information about the Digitalmars-d mailing list