Quick information on Generics

Update Jan 7, 2005: Generics will be CLS Compliant!

I’ve recently received a couple of questions on how generics will be supported across languages so I thought I would point out Julie Lerman’s blog entry on the subject of C#, VB, and J# support for generics.  C++ will have both templates that are available today and generics.  You can find out more information about the differences between C++ templates and generics at the C# FAQ blog and on Brandon Bray’s post on the subject.

Other things to note: Generics are not CLS compliant in the .NET Framework 2.0, but will be for Longhorn.

Comments (7)

  1. Ron says:

    Ugh. How come generics are not be CLS compliant?

  2. Hey Ron, I’m tracking down an official answer now….

  3. Peter Drayton, a PM on the CLR team provides the following explanation:

    "CLS consumption defines a minimum bar that all languages targeting the CLR must meet if they wish to be able to consume the breadth of .NET Framework APIs. Adding a feature such as generics to the CLS requires all the languages running on .NET (currently, about 30) to be updated to consume generics. This can be a significant change for some languages, and we felt that the best way to introduce this to our language partner ecosystem would be in a staged fashion: generics available in Whidbey, and CLS compliant in Orcas."