So the big news on Twitter among Ruby programmers is that the “hashrocket” operator has been deprecated. For those of you who aren’t Ruby programmers, here’s what that means. If you want to declare a hash literal in Ruby, right now you can do it like this:
my_hash = { :foo => "1", :bar => "2" }
Also, many methods accept hash literals as an argument, so you can do things like this:
url_for :controller => 'posts', :action => 'index'
At some point, that notation will be unsupported, and hash literals will have to declared in a different way.
When the version of Ruby is released that doesn’t support this notation, it will be incompatible with a massive amount of Ruby code. My advice to the Ruby developers would be not to do it. I don’t know what the rationale is for removing it, but the result is going to be lots and lots of servers that are simply never upgraded to that version of Ruby.
They should take a lesson from the PHP people. The migration from PHP 4 to PHP 5 has taken forever as a result of much smaller incompatibilities than this one.
Economics tells us that we have to be careful about the incentives that result from our actions. Removing the hashrocket operator creates a strong incentive to leave the Ruby upgrade path.
Update: Sometimes rumors on Twitter are just rumors on Twitter. I don’t see any mention of deprecating the => operator in the Ruby Subversion repository.
February 11, 2009 at 8:57 pm
But compare with the stuff that chromatic has been ranting about WRT Perl, where there are some incredibly crufty things that have been left around for a long time in the name of not breaking legacy code — insuring that new code that uses those crufty interfaces will get written…
February 12, 2009 at 12:16 am
More specifically, see http://www.modernperlbooks.com/mt/2009/02/toward-a-sane-deprecation-policy.html