News for hackers. Stuff that matters.
Re:Why 1 && 2 == 2 by codyb on Friday July 19, 2013 @12:28AM (#6068335)
Worth it for the memoization (I guess that's not really a word?) in Ruby. Cool new operator I did not know about.
Re:Why 1 && 2 == 2 by city41 on Friday July 19, 2013 @12:40AM (#6068364)
It's not a new operator, but rather the X= form, where `foo X= 4` is sugar for `foo = foo X 4`

Just be careful with this in JavaScript, as the greater number of things that are falsy can bite you if you do `a = a || 10;`, which is a very common JS bug.

Re:Why 1 && 2 == 2 by cheald on Friday July 19, 2013 @12:58AM (#6068405)
Watch out for this with boolean values. If you are attempting to memoize a method that returns a boolean, it'll be re-evaluated if the last iteration returned false.