Want to stay on top? Ruby Weekly is a once-weekly e-mail newsletter covering the latest Ruby and Rails news.
     Feed Icon

“and” vs && and “or” vs || in Ruby

By Peter Cooper / August 3, 2010

If you use Ruby long enough, you will discover the and and or operators. These appear at first glance to be synonyms for && and ||. You will then be tempted to use these English oprators in place of && and ||, for the sake of improved readability. Assuming you yield to that temptation, you will eventually find yourself rudely surprised that and and or don’t behave quite like their symbolic kin...

Avdi Grimm

Avdi Grimm presents a concise guide to a matter that confuses the majority of Ruby developers from time to time.

Other Posts to Enjoy

Twitter Mentions