Access the full text.
Sign up today, get DeepDyve free for 14 days.
CHAPTER 4 ■ ■ ■ 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 couple of reasons. The first reason is that exception handling is deeply ingrained in the .NET runtime and is therefore 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 late in the book, early code samples can’t use it, and that means the examples can’t be written using good programming practices. Unfortunately, this means classes must be used without really introducing them. Read the following section for flavor; we’ll cover the classes in detail in the next chapter. What’s Wrong with Return Codes? Most programmers have probably written code that looks like this: bool success = CallFunction(); if (!success) // process the error This works okay, but every return value has to be checked for an error. If the previous code was written as CallFunction(); any error return would be thrown away. That’s where bugs come from. Many different models exist for
Published: Jan 1, 2005
Read and print from thousands of top scholarly journals.
Already have an account? Log in
Bookmark this article. You can see your Bookmarks on your DeepDyve Library.
To save an article, log in first, or sign up for a DeepDyve account if you don’t already have one.
Copy and paste the desired citation format or use the link below to download a file formatted for EndNote
Access the full text.
Sign up today, get DeepDyve free for 14 days.
All DeepDyve websites use cookies to improve your online experience. They were placed on your computer when you launched this website. You can change your cookie settings through your browser.