Pluralsight blog Where devs, IT admins & creative pros go for news, tips, videos and more.
3,500+ tech & creative courses authored by experts - unlimited & online Get it now →
January 5, 2011

R.I.P. Ruby Hash Rocket Syntax 1993-2010

By

The hash rocket is dead. In Ruby 1.9, hashes whose keys are symbols can be built with a single colon.

{
  key: "value",
  dr_nic: "The Comedian",
  ttl: 42
}

No longer will you need to remember different syntax when switching between JavaScript and Ruby (or even Python!). And you’ll save at least three characters every time.

It’s one more reason to start using Ruby 1.9!

Please update your code accordingly.

Learn more about Ruby 1.9 at Pluralsight.

Inspiration from the opening panels of The Watchmen.

About the Author

is VP of Open Source at Pluralsight. He previously founded PeepCode and is an all around entrepreneur, developer, designer, teacher and athlete. Follow him on Twitter at @topfunky.


Discussion