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

Posted by: Joe Walker on 02/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.


About Joe Walker

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.

More About Joe »

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 7
  • Agility
  • Testing: Geb, Spock, Easyb
  • REST
  • NoSQL: MongoDB, Cassandra
  • Hadoop
  • Spring 3
  • Automation Tools: Git, Hudson, Sonar
  • HTML5, Ajax, jQuery, Usability
  • Mobile Applications - iPhone and Android
  • More...
Learn More »

NFJS, the Magazine

December Issue Now Available
  • BDD and REST

    by Brian Sletten
  • Mocks and Stubs in Groovy Tests

    by Kenneth Kousen
  • Algorithms for Better Text Search Results

    by John Griffin
  • Knowns and Unknowns of Scrum and Agile

    by Brian Tarbox
Learn More »