-1
votes
1answer
169 views

How to determine what throws an exception [closed]

Whenever I encounter crashes, the exact type of the exception usually already gives enough info to easily find the culprit. FileNotFoundException will hardly occur while using sockets. Now recently ...
3
votes
2answers
732 views

CA1819: Properties should not return arrays. Does this happen only with arrays? If yes, why?

I have a question about CA1819 msdn performance warning. The rule is: Arrays returned by properties are not write-protected, even if the property is read-only. To keep the array tamper-proof, the ...
29
votes
9answers
9k views

Is catching general exceptions really a bad thing?

I typically agree with most code analysis warnings, and I try to adhere to them. However, I'm having a harder time with this one: CA1031: Do not catch general exception types I understand the ...
4
votes
3answers
2k views

Why use sealed instead of static on a class?

Our system has several utility classes. Some people on our team use (A) a class with all-static methods and a private constructor. Others use (B) a class with all-static methods (these the juniors). ...
2
votes
2answers
285 views

Are there any good tools to help implement or enforce the proper equals and hashcode patterns for c#? [closed]

A very common bug on my development team is forgetting to, or incorrectly overriding equals and hashcode. While the pattern is simple, there's a lot of boilerplate code that goes into doing this ...