Named parameters

Shammah Chancellor via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 24 12:59:16 PDT 2015


On Friday, 24 July 2015 at 19:45:55 UTC, Jonathan M Davis wrote:
> On Friday, 24 July 2015 at 14:15:11 UTC, Shammah Chancellor 
> wrote:
>> Since D has optional arguments -- why don't we support named 
>> parameters?  There are extremely handy and work beautifully in 
>> languages like C#.
>
> We've argued about this several times in the past. We're not 
> adding them. They interact badly with overloading (especially 
> if you try and add more overloads later), and they make it so 
> that the parameter names are part of the API, which means even 
> more bikeshedding and arguments about naming.
>
> - Jonathan M Davis

Funny, they work beautifully in C#.

https://msdn.microsoft.com/en-us/library/dd264739.aspx


More information about the Digitalmars-d mailing list