Best practices

Avoid silent failures & confusions in Ruby Hash

How to enjoy the power of Ruby Hash without compromising readability and maintainability

Duong Nguyen
Level Up Coding
Published in
4 min readJun 12, 2020

--

Photo by NeONBRAND on Unsplash

Have you ever mistaken between options[:name] (symbol key) and options['name'] (string key) and your code silently failing with nil value because of the wrong key type?

--

--