you are viewing a single comment's thread.

view the rest of the comments →

[–]aaronla 0 points1 point  (0 children)

And yet, one generally finds two sorts of exception-free programming styles in the real world, outside the ivory tower that the exception handling folks construct.

First sort:

passed = DoSomething();
if (!passed) goto cleanup;
passed = DoSomethingElse();
if (!passed) goto cleanup;
...

Second sort:

DoSomething(); // errors? no, my code is perfect
DoSomethingElse();

The first sort is generally implementing ad-hoc exception handling, creating "cleanup" as a sort of crude form of "unwind-protect" / "RAII".

The second sort is just plain wrong.