3 ms·
I'm not sure that the new "valueless" hash syntax is an improvement. From my experience with Typescript, it's a common source of bugs. But I'm sure that people
by toomanybeersies 5y ago
I'm not sure that the new "valueless" hash syntax is an improvement. From my experience with Typescript, it's a common source of bugs.
But I'm sure that people had similar complaints when compact hash syntax was introduced in Ruby 1.9, and now nobody even thinks about it. So I'm sure I'll survive.
- maxfurman 5y agoI'm in the opposite camp - I love the short object syntax in JS and the way it mirrors destructuring. I'm very happy to see something similar come to Ruby! But, that said, I think that the Ruby version is ugly compared to JS and the extra colons are noisy. I assume there's some reason why the parser can't read `{ x, y }`, as ruby is notoriously hard to add syntax to.
- pqdbr 5y agoCount me in as well, very happy to see this addition.
- hvis 5y ago> I assume there's some reason why the parser can't read `{ x, y }`, as ruby is notoriously hard to add syntax to. Something in the parser using the colon after the first identifier to disambiguate between hashes and blocks, probably.