Is there any valid reason to ever ignore a caught exception

后端 未结 24 1949
南笙
南笙 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:13

    Think of it this way - if you are expending the CPU cycles to catch the exception but then swallowing, you are ignoring a potential issue and wasting CPU. As many have said the application should not be throwing that many exceptions unless you have something poorly constructed.

提交回复
热议问题