title: Is #inject on hashes considered good style?
body: <p>Inside the Rails code, people tend to use the <code>Enumerable#inject</code> method to create hashes, like this:</p>
  
  <pre><code>somme_enum.inject({}) do |hash, element|
    hash[element.foo] = element.bar
    hash
   end
  </code></pre>
  
  <p>While this appears to have become a common idiom, does anyone see an advantage over the "naive" version, which would go like:</p>
  
  <pre><code>hash = {}
  some_enum.each { |element| hash[element.foo] = element.bar }
  </code></pre>
  
  <p>The only advantage I see for the first version is that you do it in a closed block and you don't (explicitly) initialize the hash. Otherwise it abuses a method unexpectedly, is harder to understand and harder to read. So why is it so popular?</p>