Chapter 11: Summary

Throwing an exception produces a significant performance hit. A single exception causes lots of runtime stack information to be loaded and processed—data that would not otherwise be loaded—and it takes a considerable amount of time to handle. As pointed out in Chapter 5, you should use exceptions only to handle exceptional circumstances; APIs should provide mechanisms to check whether an exception will be thrown instead of forcing a particular API to be called to determine whether an exception will be thrown.

The next chapter introduces generics.10 In fact, it essentially deprecates any use of the System.Collections namespace, which was formerly used in nearly every project.


10. A feature starting in C# 2.0.
{{ snackbarMessage }}