News for hackers. Stuff that matters.
Re:Diggin’ and Fetchin’ with TruffleRuby by tomc1985 on Wednesday August 25, 2021 @08:52PM (#28309221)
Funny, my first thought on reading this was, "why doesn't she just use `&.` and `||` and call it a day" until I realized that it's a syntax error if you try to use that with `.[]`

Note there is also `data[:response][:message] rescue IdentityObject.new` if you don't mind the clumsy exception handler...

Perhaps this is my Perl background showing, but `.fetch` just doesn't feel Ruby-like. Ruby's syntactical terseness around hashes (and regular expressions, with `=~`, `$1`, and friends) is one of my favorite features of the language. If I have to do my hash grabs with a typed word, I might as well be writing Python

There are no comments on this comment yet.