Is there any valid reason to ever ignore a caught exception

后端 未结 24 1868
南笙
南笙 2020-11-27 15:43

Wow, I just got back a huge project in C# from outsourced developers and while going through my code review my analysis tool revealed bunches of what it considered bad stuff

24条回答
  •  执念已碎
    2020-11-27 16:26

    It depends on the framework. Badly implemented frameworks might actually require this. I recall a hack in VB6 where there was no way to determine whether a collection contained an element. The only way was to try to retrieve the element and swallow the error.

提交回复
热议问题