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

Jonathan Marler johnnymarler at gmail.com
Thu May 14 20:42:03 UTC 2020


On Thursday, 14 May 2020 at 19:55:02 UTC, Steven Schveighoffer 
wrote:
> On 5/12/20 2:22 AM, Jonathan Marler wrote:
>> 
>> I'd really like to see the DIP include a proposal on parameter 
>> naming conventions for the standard libraries before we enable 
>> this.
>> 
>
> [snip]
>
>> 3. ...
>
> Another convention could be -- if a parameter starts with 
> underscore, then the expectation is that you don't use named 
> parameters with that argument. Such parameter names should 
> always come first, and are subject to the parameter name 
> changing without considering it to break code.
>
> If you use _xyz as a named parameter, and the name changes to 
> _abc, that's your fault.
>
> Just an idea, in the event that we cannot find a good way to 
> have the compiler prevent named parameter usage.
>
> -Steve

Yeah even if it's not enforced, a convention like that would be 
fine with me.  We just have to get everyone to agree on the 
convention....which is easier said than done :)


More information about the Digitalmars-d mailing list