News for hackers. Stuff that matters.
Re:Say What You Mean (in JavaScript) by WesleyJohnson on Tuesday May 18, 2010 @04:06PM (#1358852)
I find it readable if you're trying to test both sides of the && to be true -- if(foo() && bar()){ // do this }

However, the way it's written in the article, the intent is to merely test foo() and then execute bar() if foo() returns true. Even though I'm familiar with &&, it took me a minute to understand this as well. I'd be eqaully annoyed seeing this in production code.

Re:Say What You Mean (in JavaScript) by JshWright on Tuesday May 18, 2010 @04:16PM (#1358885)
I'm with the GP on this one... Readable code is very important. Using the short-circuiting property of && doesn't decrease readability in most cases (unless someone isn't familiar with the language, or the concept of using short-circuiting for flow control).
Re:Say What You Mean (in JavaScript) by DrSprout on Tuesday May 18, 2010 @04:20PM (#1358901)
I've always found the Perl

foo() or die();

idiom to be quite readable. And if you're familiar with that, this is a pretty straightforward extension.

Re:Say What You Mean (in JavaScript) by scott_s on Tuesday May 18, 2010 @05:00PM (#1359065)
It's a common idiom in many programming languages.