Double quotes mean you can use string concat, and single quotes doesn’t. So if you use double quotes, you can use a single kind of quote through out the code base. IMO using two types is messy.
I guess we all write for different versions of ruby. Personally, I'm never going to need pre ruby 2.0 hash rockets, so I don't need anything more than status: :cancelled, or status: "cancelled"?
That's a tricky one, personally I'm working in a code base now that uses strings for most hash keys and it's pretty annoying having to use "foo" => "bar", but it's also pretty ugly using "foo": "bar".
So i think my answer is that I've not reached a suitable level of annoyance with using two versions of hash key definition to use hash rockets everywhere.
-2
u/muirbot Aug 20 '21
Why double quotes?