Thursday, 5 August 2010

Link: Mind your ands and ors

I've posted before about the subtle (and insidious) difference between the 'and'/'or' operators and the nearly-but-not-quite-the-same '&&' and '||' operators... but likely lost amongst the rest of the noise in my acts_as-good_style post.

This post: Using “and” and “or” in Ruby does a much better job of explaining when to use each one - and goes further to suggest that you shouldn't simply give up on using 'and'/'or', describing their usage as control-flow operators.

It's a small thing, but every bit helps.

No comments: