SuppressMessage with FxCop and NON-Team System Visual Studio

If you're using Visual Studio 2005 Team System then FxCop is completely integrated and when you exclude messages it automatically applies the new SuppressMessage attributes to the appropriate location in code. But if you're using Visual Studio Professional edition then you have to use the external FxCop 1.35 UI. If this is the case, you can STILL utilize the SuppressMessage attribute but have to do a couple of things first. I had to do a little digging but the steps are pretty simple. It turns...


Not all string comparisons created equal

Not all string comparisons will perform the same but I was interested in seeing what exactly the differences were. Regardless of whether I was just performing 1 string comparison or 1 million, using the instance Equals() method was BY FAR the fastest. Of course the danger there is it will fail if the first string is null. Using == will always work regardless of nulls and for a million comparisons was almost as fast as Equals() and WAY faster than any other method (although it should be noted th...


Limitations of Generics Polymorphism

With the advent of .NET 2.0, Generics is undoubtedly the single most important language enhancement.  However, to use generics to the full potential, developers should understand both the capabilities and limitations of generics as they relate specifically to polymorphism.  In short, while generics do support some polymorphic behavior, the use of Interfaces should still be the preferred polymorphic mechanism in many cases. First, an example of polymorphic capabilities, abstract class Pers...