From the fact that I understand little, most operations with Generics occur at the IL level, so there are not so many performance impacts, if any. All he does is force and validate objects of a certain type. The biggest is the understanding of contravariance and covariance. Here are some articles about this.
Articles
Using interface differences for shared collections
Frequently Asked Questions about Covariance and Contravariance (.NET 4.0 Update)
Pros
With generics, you get type safety both at runtime and in your development time. You can get intellisense about your objects in real time, as if they were hard-coded for a specific type. This is very useful when setting up both extension methods and ... and much more. In fact, starting with .NET 2.0, I don’t even find myself a more universal list for anything more, unless the type is object
As others have noted, this prevents the need for unpacking.
Vs
Due to the different nature of contravariance and covariance, confusion may arise as to what is and is not acceptable in labor time. For example, if you are considering the following layout.
interface IBase { } class Alpha : IBase { } class Beta : Alpha { } IList<IBase> ListOfObjects { get; set; }
This is confusing. Can you list Alpha and Beta objects in a list? When I tried, you couldn’t. But then it worked ...
IList<Alpha> ListOfObjects { get; set; }
He accepted Alpha and Beta objects because Beta inherits Alpha
Take a look at more information on contravariance and covariance here . It is very useful.
I have never noticed performance hits from generics. However, this does not mean that they do not exist. However, they are just simple objects, so I don’t see where the overhead will be. In the general case, the compiler should not even run code in which you try to add the wrong objects to the general list, and if so, somewhere you made a constructor error or use dynamics , or work on the issue of contravariance and covariance. Although I understand that some of them have changed since .NET 4.0.