How to use Ruby's English "and"/"or" operators without going nuts
Ruby has both symbolic (&&/||) and English logical and/or operators. The differences between these operators can be confusing, to the point that many programmers simply avoid using the English versions entirely rather than deal with their sometimes surprising behavior. I’ve made a screencast which explains why the very features which make these operators problematic in a boolean logic setting also make them perfect for certain elegant control flow idioms.
Post a comment