title: pushing elements onto an array in a ruby Hash
body: <p>In Ruby, to create a hash of arrays and push elements onto those arrays, I've seen two idioms.  I'd like to know which one people prefer, and why.  (Disclosure: I have my own opinion, but I want to make sure I'm not missing something obvious.)</p>
  
  <p>Approach 1: use Hash's fancy initializer:</p>
  
  <pre><code>ht = Hash.new {|h,k| h[k]=[]}
  ht["cats"] &lt;&lt; "Jellicle"
  ht["cats"] &lt;&lt; "Mr. Mistoffelees"
  </code></pre>
  
  <p>This approach creates an empty array when you access ht with a key that doesn't yet exist.</p>
  
  <p>Approach 2: simple initializer, fancy accessor:</p>
  
  <pre><code>ht = {}
  (ht["cats"] ||= []) &lt;&lt; "Jellicle"
  (ht["cats"] ||= []) &lt;&lt; "Mr. Mistoffelees"
  </code></pre>
  
  <p>Do people have an opinion on which one is better (or situations where one is preferred over the other)?</p>