Named Parameters (Was: A nice way to step into 2012)

Don nospam at nospam.com
Sat Dec 31 03:27:45 PST 2011


On 31.12.2011 02:37, so wrote:
> On Thu, 29 Dec 2011 23:59:46 +0200, Jonathan M Davis
> <jmdavisProg at gmx.com> wrote:
>
>> Introducing named arguments makes a function's parameters part of the
>> API and
>> introduces yet another point where code breakage can occur due to code
>> changes. And that is a _very_ negative aspect of named arguments IMHO.
>
> Yes but luckily i think it is the only downside. You have to edit, if
> you (or your boss) asked for.
> Now only question is if it worths. Remembering all those cryptic
> parameter passing cases i think it does.
> And good thing is that it is an additive change to the language.

But if you're a library writer, and you change a parameter name, users 
_will_ complain. In practice, this means you can't change them, even if 
it was a really bad name.

I also find it interesting that at the same time as we're making 
anonymous functions much easier to write, people want to remove the 
ability to have anonymous parameters.

It isn't an additive change to the language. It reinterprets existing code.




More information about the Digitalmars-d mailing list