In an old blog entry titled Cleaner, more elegant, and harder to recognize, the author states:
In C++ it's not quite so bad because C++ exceptions are raised only at specific points during execution. In C#, exceptions can be raised at any time.
What exactly does he mean by that?
First, I would hesitate to accuse Raymond Chen of confusing anything with anything.
I suspect he means that in C++, exceptions are only thrown where there exists a throw
statement. As long as you go deep enough into your code and library functions, you can determine exactly where exceptions may be thrown from. On the other hand, in C# there may be exceptions thrown by the runtime environment at any time. For example, you could get a security exception trying to call any function in any other assembly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With