Date: 2008-07-19 12:44 am (UTC)
A variant of that, if memory serves, is the deadly Java

if (condition);
     do_something();


See, you'll always do_something, because (condition) only applies to the statement immediately afterwards ... and that statement ends with the first semicolon. But semicolons are so common in Java it's very easy for the mind to overlook the fact that the first one there is spurious, and what you wanted to write was

if (condition)
     do_something();


(and as you point out, what you really wanted to write was
if (condition) {
     do_something();
}

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting
.

Profile

ninja_coder: (Default)
ninja_coder

Most Popular Tags

Powered by Dreamwidth Studios

Style Credit

Expand Cut Tags

No cut tags