This is such a superficial argument — even more superficial than the feature it's criticizing. It's only <i>possibly</i> misleading if you aren't familiar with the syntax, and that's true of a whole boatload of things, such as block syntax. The hashrocket itself looks bizarre and excessively noisy to people coming from JavaScript or Python or pretty much anything but PHP.<p>This really is just, "I am not used to this syntax, so it looks weird to me." It's the same argument some people make against calling methods without parentheses in Ruby. If you're the sort of person who writes "self.houses().map(){|house| house.sale_price()}.sort()", then I guess at least you're being consistent. If not, don't be that guy.<p>More philosophically, Ruby is a TIMTOWTDI language. There are five different and largely interchangeable ways to create a Proc, half the core library methods are aliases for other methods, several keywords are just slight variations on each other for no purpose other than to give you options, you can take or leave parentheses, etc. The new hash syntax is just one more example of this ethos. If this embarrassment of ways to write any given program bothers you (and you're certainly in good company if it does), you'd probably be more at home with Python. (I don't mean to tell anyone their business, I'm just saying, "only one way to do it" is the Python philosophy.)
Clojure made me realize that both of these styles are silly. Why do you need hashrockets, colons, or even <i>commas</i>? Why do you need a key/value separator AND a pair separator?<p>They might be useful as separators sometimes, but why are the absolutely required? They seem like noise. Anyway... I'll stick with hashrockets because the colon at the end is just confusing.
My issue with the new syntax is bringing other people up to speed. Two syntaxes for the same functionality can be confusing <i>especially</i> when it's similar to another language such as javascript. I, a rubyist for a whole year and a half now (sarcasm), thought it had something to do with only JSON at first glance. I myself will be sticking to the hash rocket.
A bit of history: this syntax originally appeared in MacRuby and is used for the named parameters needed to call ObjectiveC methods:<p><pre><code> person.setFirstName(first, lastName: last)
</code></pre>
So, introducing it into Ruby 1.9 gave MacRuby the ability of hooking into valid ruby syntax to do its special thing.<p>As a wild speculation, it may also be used for named parameters, should they ever be introduced in Ruby.<p>Personally, i like it for exactly that case. I do not like it as a generic hash syntax for another reason: its easy to align the =>, but its hard to align the:.
I don't think I like it either, but I'm pretty sure it's just because colons are already very commonly used in hashes as symbol delimiters.<p>{foo: :bar} just feels <i>weird</i>.<p>It's not a world-ending issue - certainly not enough to make an effective difference in practical usage - but it's enough of a visual collision that it rubs me the wrong way.
My only misgivings about the new syntax is that these sorts of lists now look rather dumb:<p><pre><code> foo: :bar,
baz: :quux,
wub: :bozo
</code></pre>
(This is, admittedly, a very subjective complaint. We could start calling this new double-colon syntax collision "Paamayim Nekudotayim".)
As someone with no Ruby experience, I was reading through the lasted RoR config files recently, and I encountering these key/vals separated sometimes by a comma, other times by a colon, sometimes by nothing with the colon on the wrong side. I had to research new Ruby syntax for an hour to figure it out.<p>If you are unfamiliar with Ruby symbols to begin with then it's tough on the brain because there is no discernible pattern.
name: value instead of :name => value makes as much sense as p->q instead of (*p).x in C<p>As an historical note, here are the message (and matz’s response) where I made a proposal for the new syntax, back in 2002. It includes rationals.<p><a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/38391" rel="nofollow">http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/...</a><p>Matz’s response : <a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/38402" rel="nofollow">http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/...</a>