The assumption being that the language you are using does not have named parameters. Something all modern languages have, except, as usual, the ones the world is built on (JS, Java).
https://www.youtube.com/watch?v=_ahvzDzKdB0
It's one of the best programming talks I've come across. For 1998, all his points on growing a new programming language are spot on.
And then Java became the opposite of a lot of the goals he enumerated.
function foo({bar, baz}) { ... }
foo({bar: 1, baz: false})
In other words, this blog post is practically irrelevant to those languages.
And correct me if I'm wrong, nothing worse than an incorrect pedant.
The ([…, ]{…}) approach is called “options object” which is a separate entity and is very convenient compared to e.g. python’s semi-infinite arguments lists.
My ideal language would have function prototypes that look something like:
return_type function_name(parameter_name type (default_value) [constraints], ...)
If the default value is not set then the parameter must be passed or it is a compile error. function foo({x, y, z=1}) { ... }
It eschews positional parameters though, but makes passing aptly-named variables as arguments easy: const x = 1; // Usually a complex computation instead.
const y = 2 * x;
return foo({x, y});