Project

General

Profile

Actions

Feature #12157

closed

Is the option hash necessary for future Rubys?

Added by justcolin (Colin Fulton) over 8 years ago. Updated about 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:74219]

Description

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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0