3 ms·
> it was a good idea to eventually make them a full-fledged feature Why so?
by throwanem 3y ago
> it was a good idea to eventually make them a full-fledged feature
Why so?
- gls2ro 3y agoPositional arguments creates a dependency on the position of the argument. And this is a cause of bugs when calling a method with the arguments in the wrong order. Keyword arguments remove the depedency on the position.
- vidarh 3y agoBecause it provides a clearer way of enforcing calling conventions. Calling a method with the wrong keyword argument raises an error automatically. Calling a method with hash arguments the method expect replies on the method manually checking for unexpected keys. In Ruby as in other languages it was error prone.