Quote:
Originally posted by John E
But goto only has one destination too. Of course, different goto's can have different destinations - but then, different throw's can also have different destinations.
At least with goto, you can't jump out of the current function (you can't, can you?? I've never tried it). The problem with throw is that you can end up in a totally different function. To me, this seems to be just as unstructured - in fact, more so - than goto. So why is throw good, when goto is bad?
Well...I know that it is personal flavor at the end, however, even the point that a thrown exception can be handled within a completely different part of the application is an advantage for a well-designed error handling routine. It gives you the possibility to handle an exception at the exact location where it makes the most sense to actually handle it.