News for hackers. Stuff that matters.
Re:No ifs...alternatives to statement branching in JavaScript by scott_s on Friday August 06, 2010 @10:59PM (#1582977)
We sometimes use if-else statements to write out some straight-up logic because we don't understand it at first. So we build it from the ground up. If, after writing it all out with primitives, we realize "Oh, it's just this anded with this and ored with that" then we actually understand the problem.

Put another way: if you write a boolean expression as a sequence of statements, my assumption is you don't really understand what you're doing.

There are no comments on this comment yet.