I work mostly in C++, and this is a feature I've wished for for a long time.
I work mostly in C++, and this is a feature I've wished for for a long time.
https://learn.microsoft.com/en-us/dotnet/csharp/programming-...
> "When you use named arguments in a function call, you can freely change the order that they are listed in."
That violates a key requirement in my specification, which means that I regard it as broken.
Positional parameters should take arguments only in their designated argument position.
Only non-positional parameters (keyword parameters) should be allowed to be specified in any order.
struct SomeArgs { bool normalize{false}; int stride{2}; char ch{'x'}; ... some other stuff };
void someFn(SomeArgs args);
someFn({ .stride = 1, .ch = 'y' }); someFn({ .normalize = true });
not as simple as python but it's close-ish and more readable than: someFn(false, 2, 'c');
fetch(accountId, history: true, details: false);