December 7, 2010

Just for Fun: LOL Bugs

The three funniest bugs I've ever seen. Two of them are mine.


C++:
for(int i=0; i<100; i++);
{
    // Do stuff
}
"I said run 100! WHY is it only running once!?!?!"

Ruby:
post.each{ |line|
   foo(post)
   ...
}
"It never processes a single line!"

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?"

1 comment:

  1. 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