Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

28
  • 32
    Your answer makes it sound as though exceptions are bad for all circumstances, while the quesion is focused on exceptions as flow control. Commented Mar 4, 2013 at 22:46
  • 20
    @MasonWheeler The difference is that for/while loops contain their flow control changes clearly and make the code easy to read. If you see a for statement in your code, you don't have to try to figure out which file contains the end of the loop. Goto's aren't bad because some god said they were, they are bad simply because they are harder to follow than the looping constructs. Exceptions are similar, not impossible but hard enough that they can confuse things. Commented Mar 5, 2013 at 0:02
  • 28
    @BillK, then argue that, and don't make over simplistic statements about how exceptions are gotos. Commented Mar 5, 2013 at 0:14
  • 9
    Okay but seriously, what is up with server-side and app devs burying errors with empty catch statements in the JavaScript? It's a nasty phenomon that has cost me a lot of time and I don't know how to ask without ranting. Errors are your friend. Commented Mar 5, 2013 at 4:43
  • 26
    @mattnz: if and foreach are also sophisticated GOTOs. Frankly, I think the comparison with goto isn't helpful; it's almost like a derogatory term. GOTO usage isn't intrinsically evil - it has real problems, and exceptions might share those, but they might not. It would be more helpful to hear those problems. Commented Jan 11, 2015 at 12:12