Named parameters

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 24 15:19:54 PDT 2015


On Friday, 24 July 2015 at 19:59:17 UTC, Shammah Chancellor wrote:
> 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

The example presented in there would benefit from extra typing 
rather that named argument. D provide this, but C# doesn't as far 
as I know.


More information about the Digitalmars-d mailing list