Issue #12157 has been updated by Robert A. Heiler.


You forget that some people - like me - may use a hash because it is a lot simpler and more convenient too.

I don't have to wonder about any positional arguments ever and I don't want to have to think.

With a hash I don't have to think.

Removing the optionality of braces is not a good idea, because it simply is not necessary. Colin Fulton
reasons that they can be removed now because keyword args are possible but that is not a "either or",
ruby has an "and - and" philosophy.

I do not feel that hashes used for options are redundant in any way, they are synergistic and partially
overlapping in their use case, just as many other parts of ruby also are.

I also do not see how your use of double splat has anything to do with option hashes at all since you
do not need ** for a hash either.

> Unlike named arguments, options hashs allow you to have keys which are not symbols, but I haven't seen
> many places where that is needed. 

Then perhaps you have not heard of HashWithIndifferentAccess or older discussions about whether to use
'key' or :key for any given hash. User input tends to be given in via a String input so you'd always
have to convert into a symbol before storing in a Hash.

> Option hashes were great before Ruby had named arguments

Option hashes are still great.

I am very much against removing hashes for options as per this proposal just because
of some arbitrarily perceived keyword arguments being "superior" and any alternative
means being "inferior".

----------------------------------------
Feature #12157: Is the option hash necessary for future Rubys?
https://bugs.ruby-lang.org/issues/12157#change-57620

* Author: Colin Fulton
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
Option hashes were great before Ruby had named arguments, but with the addition of named arguments and the double splat operator are they still needed?

One can convert named arguments into an option hash by using the double splat operator in the parameter list, so option hashes are redundant. More importantly, the existence of both option hashes and named arguments is creating odd or ugly edge cases. See #12022, #10708, and #11860. Legacy software can mostly be updated using a double splatted parameter, so it shouldn't be a hard shift to make.

What do you all think?

_Apologies if this discussion has happened before. I searched for a bit but couldn't turn anything up._



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>