<p>I believe this question belongs to Stack Overflow.</p>

<p>I see two cons :</p>

<ul>
<li><p>Googleing "exceptions are slow" gives you results on Stack Overflow about various languages (.net, java). It seems that speed is not an issue, as long as exceptions don't happen <em>too</em> often.</p></li>
<li><p>Like stated <a href="https://stackoverflow.com/questions/299068/how-slow-are-java-exceptions">here</a>, "you really should recognize that using an exception for program flow is no better than using GOTOs". Whether GOTOs should be used or not is up to you, but relying only on them is surely going to make your code unmaintainable.</p></li>
</ul>

CC BY-SA 2.5
2010-08-29T17:02:34.187Z
2010-08-29T17:02:34.187Z
2017-05-23T12:40:09.333Z
Suzanne Soy
<p>Is it appropriate to use Exception handling for flow control of our programs ?</p>

<p>There are some programming languages/circumstances where we can't avoid it Exception handling for flow control. Should we strictly avoid it?</p>

CC BY-SA 2.5
2010-08-29T16:20:57.273Z
I think this question may be more appropriate for Stack Overflow.
Emil
<language-design>
Exception handling for flow control ?
Xinus
# Exception handling for flow control ?

(Asked by: username_0 on 2010-08-29)

Is it appropriate to use Exception handling for flow control of our programs ?

There are some programming languages/circumstances where we can't avoid it Exception handling for flow control. Should we strictly avoid it?

**Tags:** language-design

> **Comments:**
> **username_1**: I think this question may be more appropriate for Stack Overflow.  

---

## 1 answers

### Answer by username_2 on 2010-08-29. Score: 3

I believe this question belongs to Stack Overflow.

I see two cons :

* Googleing "exceptions are slow" gives you results on Stack Overflow about various languages (.net, java). It seems that speed is not an issue, as long as exceptions don't happen *too* often.
* Like stated [here](https://stackoverflow.com/questions/299068/how-slow-are-java-exceptions), "you really should recognize that using an exception for program flow is no better than using GOTOs". Whether GOTOs should be used or not is up to you, but relying only on them is surely going to make your code unmaintainable.


---

