Empty Catch Blocks
I’ve just found 22 examples of this anti-pattern in a small .NET project:
try
{
// (Stuff here)
}
catch {}
Oh yes, the empty catch block. Joy of joys.
Declaring an empty catch block is equivalent to professing that:
"Sometimes this code I’ve written fails. I don’t know why. I don’t really care. Please don’t tell me when it happens. I can’t hear you. La la la…"
*sigh*
If I ruled the world, empty catch blocks would be invalid in C#. Is there ever any reason for using them?
Comments ()