try/swallow

Posted August 21, 2008 in .net-framework wtf
Reading time: 0 minutes

Dear fellow coders,

Please don’t ever do this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
private static void SomeFunc()
{
    try
    {
        DoSomething();
        DoSomethingElse();
    }
    catch
    {
        // eat the exception  <– NO!  BAD CODER!
    }
}

Love,

Jon



Comments

comments powered by Disqus