The Joy of Programming: if(false);
There comes a point in every mans life when he is up at 3am trying to debug some god awful mess, and it turns out that it was just a semicolon in the wrong place. I had this happen to me recently with the following piece of code.

This if statement looks honest enough. Sets the characters animation to RUNNING if his velocity is > 2. Right? Wrong! Unfortunately for us, a rogue semicolon was placed at the end of the if statement. This causes the code above to ALWAYS set the running animation, regardless of the outcome of the if statement. This is a difficult to spot bug because it isn’t a compile time error, and doesn’t even cause Netbeans to throw a warning. So the next time you have an if statement acting weird, check for rogue semicolons!


