17 Mar '12, 8pm

@mboeh @mperham Yeah. Way too much confusion possible. Also "and" looks like English. "&&" screams "operator" to me.

nIf you look back at the history of Perl, which is where 'and' and 'or' come from, they were explicitly introduced not for readability, but because sometimes the low precedence operators were what you wanted. In Perl, with it's assignment contexts, it really makes sense. Code like: my @fileinfo = stat($file) or die; behaves very differently from: my @fileinfo = stat($file) || die In the second case, the stat gets forced into a scalar context, which is almost certainly not what you want. About the only place you see the 'english' logical operators in good perl is in the 'assignment or die' idiom. In Ruby it makes sense to use them in that context too: value = possibly_false || raise "foo" is a syntax error, and so is: (value = possibly_false) || raise "foo" but value = possibly_false or raise "foo" works fine. Me, I like the '... or raise' approach, but that's pretty much t...

Full article: http://blog.jayfields.com/2007/08/ruby-operator-precedenc...

Tweets

webinar

element14.com 24 Mar '12, 10pm

Ruby Platform Options Throwdown:

engineyard.com 21 Mar '12, 3am

Engine Yard, Inc. Log in Login to Engine Yard Cloud Login to Orchestra PHP Cloud Products Engine Yard Cloud Engine Yard Ma...