First it was used for simple error conditions like invalid parameters, then it was used as a shortcut e.g. to save changing void functions to return error codes, then it was used with the apparent belief that the instruction pointer would stop moving without it.

The first time I saw C# used at Microsoft, every single operation in code was an SEH block of some kind. I had been a big fan of C#; I loved its strong typing, properties, the elimination of multiple inheritance. What I saw turned me off to it for decades. In that time I saw C++ destroyed by SEH abuse.

But yes, throw has the same problem as goto, which never had an accompanying comefrom. I’m trying not to repeat myself here but come, let us be empirical together; when SEH became integral to most code we saw a huge loss of stability. Not a coincidence.

And I am far from a performance obsessive but throw exacts a huge penalty, which is why most development on slower processors forbids it.

I don’t use it. I can’t stop others from using it but if we must then it should be restricted to its original intent: handling exceptions.

Real ones.

American Software Developer living in Vietnam. Classical musician (guitar, woodwinds), weightlifter, multilingual, misanthrope • XY

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store