O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lessons Learned

Common themes can be identified between Win32 and COM, including the need for manual checking against error conditions, leading to a huge number of branches in code bases. Furthermore, error codes are based on symbolic constants that can be hard to find, often leading to forgotten cases of error handling. Mixing those disadvantages with the need for manual resource handling in both cases only makes matters worse, often sacrificing block-based structured programming in favor of goto statements to centralize resource cleanup. Improper cleanup often leads to memory problems that can be hard to track down.

Clearly, we can do better by introducing more structure to deal with exceptions. This is where structured exception handling comes ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required