Skip to content

Comment on Keyword Arguments: Ruby, Clojure, Common Lisp

Comments

He spends a lot of time on the syntactic ambiguities of keyword arguments in Ruby when calling without parens. I understand how that's annoying, but how hard would it be to just put the parentheses back? He seems to be making a mountain of a molehill on that point.

Seriously. I can't think of any language feature in any other language that is heaped with so much passion (both positive and negative), while being entirely mundane.

Optional parens are great for building DSLs and bad for everything else.

As a rule of a thumb, I don't omit parens outside macros like `before_filter :smth` or `validates_presence_of :smth` or RSpec DSL `it "should ..." do`.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.