C++:
for(int i=0; i<100; i++);"I said run 100! WHY is it only running once!?!?!"
{
// Do stuff
}
Ruby:
post.each{ |line|"It never processes a single line!"
foo(post)
...
}
Java:
System.out.println("Using " + 1 + runtime.availableProcessors() + " threads.");
"I know it's multicore, but my computer doesn't have, like, 11 processors does it?"
The semicolon masking the block is still one of my favorite c++ bugs. Granted, the compiler should give a warning. Everyone does treat warnings as errors, right? :)
ReplyDelete