Pretty please: Named arguments

Bekenn leaveme at alone.com
Mon Feb 28 10:55:33 PST 2011


On 2/28/11 5:11 AM, bearophile wrote:
> In recent C# versions:
> http://msdn.microsoft.com/en-us/library/dd264739.aspx
> http://geekswithblogs.net/michelotti/archive/2009/01/22/c-4.0-named-parameters-for-better-code-quality.aspx  )

I had no idea C# had adopted this feature.  Thanks!

Looking through that first link, it looks like their rules are very 
nearly a match for what I came up with; the only difference I can see is 
that they'd prohibit the use of positional arguments following a named 
argument (even if the named argument is in the expected position).  My 
argument in favor of named positional arguments (after which you *can* 
continue to specify positional arguments) is that the name becomes a 
compiler-verified annotation.


More information about the Digitalmars-d mailing list