2 thoughts on “In Ruby ‘?’ binds stronger than ‘or’”

  1. I’m not sure you can call the first ‘improper’; the whole point of having separate &&/|| and and/or in Ruby is that the latter bind very weakly, so can be used for control flow, whereas the former bind rather strongly and can be used for Boolean logic. There are people who say ‘don’t ever use the and/or form’, but I do use it regularly – it’s really useful when you understand the difference. :)

  2. Yes, you are correct that the knowledge of importance order is crucial (I thought I knew it!), yet the first example reads very ambiguous. I’ve amended it to say “Improper/misleading” now.

Comments are closed.