DIP 1030--Named Arguments--Community Review Round 1 Discussion

Manu turkeyman at gmail.com
Tue Feb 11 19:02:38 UTC 2020


On Tue, Feb 11, 2020 at 5:30 AM Arine via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Tuesday, 11 February 2020 at 09:46:35 UTC, Paolo Invernizzi
> wrote:
> > Let's put It simple, and let's boil this down to essential:
> > there's MORE probability of FUTURE breakage with named
> > parameters, and that's a fact.
>
> Only if you use the feature. That's part of the reason why I
> don't think you should be able to set a default of the middle
> argument. This just forces someone to use the feature if they
> want a default parameter. Neither C# nor Python allow you to set
> a default parameter in the middle without the rest that follow
> also having default values.
>
> Other than that, if you don't want your code to break potentially
> from argument changes, then don't use named parameters.

As a library author, you can't control whether a client uses named
arguments or not. You must assume that they might use them anywhere
and everywhere.
This is huge for phobos and druntime, which should have a major pass
over all function argument names to achieve dignity before we set them
in stone.


More information about the Digitalmars-d mailing list