CHAPTER 5

image

Exception Handling

In many programming books, exception handling warrants a chapter somewhat late in the book. In this book, however, it’s near the front, for a few reasons.

The first reason is that exception handling is deeply ingrained in the .NET Runtime and is therefore very common in C# code. C++ code can be written without using exception handling, but that’s not an option in C#.

The second reason is that it allows the code examples to be better. If exception handling is presented late in the book, early code samples can’t use it, and that means the examples can’t be written using good programming practices.

What’s Wrong with ...

Get A Programmer's Guide to C# 5.0, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.