Exception Handling
- slide 29 : 30
Recommendations about exception handling
Control flow
Do not use throw and try-catch as iterative or conditional control structures
Normal control flow should be done with normal control structures
Efficiency
It is time consuming to throw an exception
It is more efficient to deal with the problem as a normal program aspect - if possible
Naming
Suffix names of exception classes with "
Exception
"
Exception class hierarchy
Your own exception classes should be subclasses of
ApplicationException
Or alternatively (as of a more recent recommendation) of
Exception
.
Best practices for handling exceptions (MSDN)