Quick tip: Do proper exception handling
This might be a bit of a d’oh, but if you decide to handle exception, handle it properly. What do I mean by saying “properly”? Have you ever seen code like this?
1 2 3 4 5 6 7 8 9 |
var myClass = new MyClass(); try { myClass.SomeMethodThatCanThrowException(); } catch { } finally { myClass.Dispose(); } |
This code is stupid. Exceptions are a sign of exceptional or unpredicted behaviour. Thus, they should be treated with all seriousness. The […]