Lecture 20
10
Error handling is painful
•Imagining all possible errors is tricky
–you routinely miss some until code breaks
–that’s why you have to test!
•Deciding what to do is often difficult (particularly if original design did not plan for handling errors)
•Error handling code
–spreads out over the whole program
–can make clean logic complicated and ugly
–often accounts for 1/4 to 1/3 of real software