|
|
|
|
|
by meepmorp
5019 days ago
|
|
> They did. It's `&&` and `||`. I assume you mean idiomatically chosen, since clearly the decision wasn't made at the language level. > I have seen skilled rubyists make great (and correct) use of `and`. I'm obviously not a ruby programmer, so it doesn't matter much to me, but it seems odd to argue that having a largely disused second set of logical operators in a language that skilled people periodically trot out for some cases is anything but a design wart. Maybe it's a cultural thing in the ruby world. And, honestly, I don't mean that to sound snide or slighting. It's just odd to me. |
|
> raise "ooops" unless do_something()
But even so, it reads a bit backwards. Some codebases do this instead:
> do_something() or raise "oops"
That's just repeating one of the examples in the article, but it jumps out to me as the one I've seen most often.