4 ms·
I'm 80% in favour of this change. JSON parsing is tedious and this looks like it will help pretty cleanly on something that rubyists do quite frequently. I coul
by 3pt14159 7y ago
I'm 80% in favour of this change. JSON parsing is tedious and this looks like it will help pretty cleanly on something that rubyists do quite frequently. I could also see myself using this pretty frequently elsewhere.
That said, I do see some minor drawbacks:
1. I personally find the case statement in ruby confusing. It uses === which I find hard to use without stopping and thinking.
2. I don't understand why the bitwise or operator is being used for the pattern matcher or. Was it not possible to just use `or` itself?
3. Deconstruct keys reads a bit weird. Easy enough to understand and remember, but I can imagine being new to ruby or programming and finding the pattern matching pretty hard to follow.