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

2 comments:

  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
  2. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

    Java Online Training Java Online Training JavaEE Training in Chennai Java EE Training in Chennai

    ReplyDelete