Why are Exceptions not Checked in .NET?

前端 未结 10 1893
忘了有多久
忘了有多久 2020-11-27 03:36

I know Googling I can find an appropriate answer, but I prefer listening to your personal (and maybe technical) opinions.
What is the main reason of the differe

10条回答
  •  无人及你
    2020-11-27 04:26

    The basic design philosophy of C# is that actually catching exceptions is rarely useful, whereas cleaning up resources in exceptional situations is quite important. I think it's fair to say that using (the IDisposable pattern) is their answer to checked exceptions. See [1] for more.

    1. http://www.artima.com/intv/handcuffs.html

提交回复
热议问题