2 Wrongs Making a Right: (false && false) = true - No Fluff Just Stuff

2 Wrongs Making a Right: (false && false) = true

Posted by: Joe Walker on February 28, 2008

I just had one of those times when I thought I totally lost the ability to do simple logic. Take a look at this screenshot:

I'll break it down: req.readyState = 4, and batch.async = false.

Last time I checked 4 = 4. So blatantly (4 != 4) is false. And false && false is blatantly uber false, as true as Alice Cooper covering Barbie Girl.

So seeing firebug step through if (false) and onto the return statement made about as much sense as trying to raise Schrodinger's cat in a séance.

I think it's another quirk in Firebug. This time it's simply something funky going on with "step over".

The moral is: Firebug sometimes lies to you about where the current line is.

This is all part of me adapting DWR so that it can be used as a connector between Jaxer and some Java server. More on that in a bit.

Joe Walker

About Joe Walker

Joe Walker is a developer and consultant working on advanced web development techniques like AJAX.

He recently developed Direct Web Remoting, (DWR) which has become the most popular Ajax toolkit for Java by making browser/server interaction intuitive for web developers. See http://www.directwebremoting.com

He currently works through his consultancy, Getahead (http://getahead.org/), which is supplying a growing number of customers with AJAX and advanced web solutions.

Why Attend the NFJS Tour?

  • » Cutting-Edge Technologies
  • » Agile Practices
  • » Peer Exchange

Current Topics:

  • Languages on the JVM: Scala, Groovy, Clojure
  • Enterprise Java
  • Core Java, Java 8
  • Agility
  • Testing: Geb, Spock, Easyb
  • REST
  • NoSQL: MongoDB, Cassandra
  • Hadoop
  • Spring 4
  • Cloud
  • Automation Tools: Gradle, Git, Jenkins, Sonar
  • HTML5, CSS3, AngularJS, jQuery, Usability
  • Mobile Apps - iPhone and Android
  • More...
Learn More »