News for hackers. Stuff that matters.
Re:Using “and” and “or” in Ruby by klochner on Monday August 02, 2010 @12:41PM (#1568108)
In that spirit, his last example could be improved:

   foo = cach[:foo] or foo = get_foo() or raise "Could not find foo!" 
   foo = cach[:foo] || get_foo() || raise "Could not find foo!"
And I've seen the "foo() and bar()" usage screwed up more than a few times by people not fully understanding the return value of foo()
Re:Using “and” and “or” in Ruby by GrandMasterBirt on Monday August 02, 2010 @07:15PM (#1569472)
This example REALLY illustrates the differences. Very nice.