13 ms·
> What's the advantage of stopping someone from naming the parameter when they pass it in? There are cases where a parameter name is worthless on the calling s
by masklinn 2y ago
> What's the advantage of stopping someone from naming the parameter when they pass it in?
There are cases where a parameter name is worthless on the calling side, this is especially common for unary or binary functions.
In that case, the ability to name the parameter on the call site just constrains the implementation, and the overrides (in the case of methods).
- IgorPartola 2y agoRight. For example, something like max() or abs() have no meaningful parameter names. But for example max() does take a `key` named argument as well.