Discussion Thread: DIP 1030--Named Arguments--Final Review

Arine arine1283798123 at gmail.com
Wed May 20 02:09:27 UTC 2020


On Tuesday, 19 May 2020 at 08:01:09 UTC, Timon Gehr wrote:
> On 19.05.20 04:35, Arine wrote:
>> On Tuesday, 19 May 2020 at 01:07:38 UTC, Timon Gehr wrote:
>>> On 19.05.20 02:05, Arine wrote:
>>>> On Sunday, 17 May 2020 at 13:25:35 UTC, Timon Gehr wrote:
>>>>> On 14.05.20 07:57, Walter Bright wrote:
>>>>>>
>>>>>> Besides, if you really don't want your users to use the 
>>>>>> parameter names,
>>>>>>
>>>>>>      int foo(int _dkfjjiufheuehgthu, long 
>>>>>> _yer_mother_was_a_hamster, double 
>>>>>> _I_did_not_read_the_documentation);
>>>>>>
>>>>>> and I bet they'll get the message.
>>>>>
>>>>> Or you can just use `int foo(int, long, double);`.
>>>>
>>>> Not that useful for open source code (the majority of D). 
>>>> Don't think I even know of or have used a single library 
>>>> that only provides .di files.
>>>
>>> int foo(int, long, double){
>>>     return cast(int)(_param_0+_param_1+_param_2);
>>> }
>> 
>> And that's better for readability? Both methods are equally as 
>> bad. That one may be worse because it is an undocumented 
>> "feature".
>> 
>
> I am not sure what your point is. Are you trying to argue that 
> the suggestion is on the same level or worse than the 
> originally proposed
>
> int foo(int _dkfjjiufheuehgthu, long _yer_mother_was_a_hamster, 
> double _I_did_not_read_the_documentation);
>
> ?
>
> If that is not your point, I think we have nothing to discuss.

Both are equally as bad in terms of readability. One is worse 
because it uses an implementation detail that can change at any 
time.


More information about the Digitalmars-d mailing list