Re:Using “and” and “or” in Ruby
by gmac on Tuesday August 03, 2010 @10:18AM
(#1571197)
I knew this, but I always find it a rather disappointing choice in the language design, as I think its capacity for inspiring bugs rather outweighs its usefulness (which extends as far as making some parentheses unnecessary).
In a nutshell: there are two forms of the AND and OR operators, with different precedences; in many contexts, you can use them interchangeably; but in some, they'll behave differently, and could bite you.
In a nutshell: there are two forms of the AND and OR operators, with different precedences; in many contexts, you can use them interchangeably; but in some, they'll behave differently, and could bite you.