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

so so at so.so
Thu Dec 29 08:49:51 PST 2011


On Thu, 29 Dec 2011 11:48:13 +0200, Don <nospam at nospam.com> wrote:

> I'm not aware of any languages where positional arguments are not  
> supported. The restrictions imposed by named arguments are a pure  
> superset of the restrictions imposed by positional arguments.

Don, it is a made up argument no one suggesting that.
Forget their implementations in other languages.
NP won't change a single thing for those that don't want to use it.

Rules must be simple. As a user you either use NP for the function  
entirely or don't use it, no mix.

> David's post implies that they are two independent approaches.
>
> It's pretty obvious what happens when you have named arguments: if you  
> make a poor choice in naming an argument, you generally shouldn't fix  
> it. Documentation suffers.
> Named arguments WILL reduce code quality in some cases.

When you change a parameter name, you change interfaces file and  
documentation.
Your user will recompile/reread regardless, because you came up with a new  
version.
Now with NP those that "want to bother" will edit their codes, he asked  
for it.

If you say someone will be forced to do that i have no argument against  
that, you are right.


More information about the Digitalmars-d mailing list