4 ms·
named arguments a la Objective C or Gleam do a similar thing - oftentimes a named argument will start with a preposition or simply be one, "from" or "to", so yo
by tomjakubowski 3y ago
named arguments a la Objective C or Gleam do a similar thing - oftentimes a named argument will start with a preposition or simply be one, "from" or "to", so you can read and write:
deliverWidget(
to: factory,
withCourier: ups
)
- paulddraper 3y agoNamed arguments are such a good idea.
- Quekid5 3y agoSadly, many languages that have them make the parameter names optional at the call site. That's a language design mistake, IMO.
- hu3 3y agoI agree. Fortunately IDEs can fill this gap by displaying parameter hints. https://blog.jetbrains.com/phpstorm/2017/03/new-in-phpstorm-2017-1-parameter-hints/ https://blog.jetbrains.com/phpstorm/2017/03/new-in-phpstorm-...
- Quekid5 3y agoIt's definitely an improvement, but it doesn't fix the fundamental issue :/