DIP 1019--Named Arguments Lite--Final Review

JN 666total at wp.pl
Fri Aug 23 19:01:35 UTC 2019


On Friday, 23 August 2019 at 16:19:51 UTC, Dennis wrote:
> You can't leave `fullScreenMonitor` to the default while 
> passing `parentWindow` with this DIP, but writing out that 
> argument doesn't seem like a big loss to me. And even if it is, 
> limitations can easily be lifted without much friction. If it 
> turns out that reordering causes problems down the line, 
> deprecating them would be more of a hassle.

It is a loss. It's basically the same situation as the thing 
people were bringing up - named arguments allow you to detect a 
case when arguments get renamed and semantics change, rect(x, y, 
width, height) vs rect(x1, y1, x2, y2). But this is almost the 
same case, except you are binding yourself to the default value 
for fullScreenMonitor to null. You want to do the default here. 
What if the default gets changed and fullScreenMonitor is 
supposed to be fooMonitor instead? You can get silent breakages 
because you're overriding the default behavior now.

I like the idea of this DIP. I think skipping over default 
parameters should be a thing.


More information about the Digitalmars-d mailing list