Daniel Turini 寫的這篇《Exception Handling Best Practices in .NET》相當不錯,內容正好跟 Brad Abrams 的《Exception handing and Memory Management》相呼應。

我不明白的是,為什麼 Brad Abrams 會認為 “catch (Exception e) is your friend”? 因為 catch {…} 中我所能想到最好的處理方式就是 “log the Exception, rethrow it, and let the program terminate”;如果不這樣做而把這個 Exception 忽略掉,反而會造成以後偵錯的困難。

有興趣的人可以參考 Is “throw new Exception(…)” a good practice 這個討論,我喜歡 David Levine 給我的答案。