What are the benefits of the new hash syntax in Ruby 1.9?

It just looks nicer–it’s syntactic sugar; it ends up being the same thing.

When mixing keys (ew, why would you do that?) I use the old hash-rocket syntax for the entire hash.

With symbol values I also use the old hash-rocket syntax for the entire hash–this looks icky:

{ ohai: :kthxbye }

I don’t like mixing the two styles in the same hash–I think it’s confusing.

This is all based on personal preference, though.

Leave a Comment