title: When to use keyword arguments aka named parameters in Ruby
body: <p>Ruby 2.0.0 supports keyword arguments (KA) and I wonder what the benefits/use-cases are of this feature in context of pure Ruby, especially when seen in light of the performance penalty due to the keyword matching that needs to be done every time a method with keyword arguments is called.</p>
  
  <pre><code>require 'benchmark'
  
  def foo(a:1,b:2,c:3)
    [a,b,c]
  end
  
  def bar(a,b,c)
    [a,b,c]
  end
  
  number = 1000000
  Benchmark.bm(4) do |bm|
    bm.report("foo") { number.times { foo(a:7,b:8,c:9)  } }
    bm.report("bar") { number.times { bar(7,8,9) } }
  end
  
  #           user     system      total        real
  # foo    2.797000   0.032000   2.829000 (  2.906362)
  # bar    0.234000   0.000000   0.234000 (  0.250010)
  </code></pre>