Skip to main content
2 of 6
added 911 characters in body
janos
  • 113.1k
  • 31
  • 68

If you've already written part of the review, then don't delete it. You've worked on it, and your effort should not be wasted.

If you haven't written anything yet, then:

  • If it looks like a simple typo, then:

    • If you're 100% sure of the fix, then just fix it, for everyone's sake
    • If you're not 100% sure of the fix, you can let others fix it

    If the code looks legitimate, you can go ahead and review

  • If the bug is blatantly obvious, then the question doesn't look legitimate, and it's best to vote to close, and probably downvote too

Keep in mind that having bugs is "perfectly normal" in software construction. And that's one of the big reasons to perform code reviews in software development in real life: several studies show that even single-line changes have a surprisingly high error rate.

Whenever you commit something to version control, you're probably pretty sure the code is bug-free. (Right?) But in reality, it's very often not. It's not surprising that askers miss some bugs too.

The example question you posted had an obvious typo. But legitimate posts with fairly complex hidden bugs are not uncommon. So it comes as no surprise that at the end of last year we even had a Best of Code Review 2014 - Exterminator category:

Answer that points out the most interesting obscure bug in the original code.

janos
  • 113.1k
  • 31
  • 68