Skip to content

Positional vs. Keyword Arguments in Ruby 2.1.2 #16

@matthutchinson

Description

@matthutchinson

Do we have opinions on the new keyword args feature in ruby 2.1.2 - specifically favouring them over methods having an options hash?

Some discussion on this here (which I kind of agree with); http://robots.thoughtbot.com/ruby-2-keyword-arguments

Usually, the code clarity and maintainability gained from keyword arguments outweigh the terseness offered by positional arguments. I would use positional arguments if I could easily guess their meanings based on the method’s name, but I find this rarely to be the case.

Given we're using Ruby 2.1.2 almost everywhere, should we update our Ruby guide to consider this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions