« Fatboy stick | Main | Testing with a Clock »

Testing, robustness and checked exceptions

Ted Leung contrasts checked exceptions with testing:

If your testcases actually tested the relevant error conditions, then you wouldn't need to have a language mechanism to ensure that the errors got handled. At least, you could make all exceptions unchecked, and eliminate the multi-arm catch hairballs that are lying around.

He also succinctly captures an aspect of checked exceptions I just couldn't put my finger on:

It's not like all those catch blocks that are empty, printing stacktraces, or logging exceptions are really improving the robustness of the systems that they are in.

To my mind, with all those try/catch blocks, there's a lot of noise going into the code for little benefit.

August 31, 2003 05:43 PM


Trackback Pings

TrackBack URL for this entry: