I’ve been following with interest various articles that have been published about the addition of Generics to .Net.

When I first saw the template classes in C++ I thought they were incredibly useful and cool - until I saw that they were essentially a trick of text processing. The gloss went right off them then.

In C#/.Net, Generics are going to be a first class concept - supported at runtime, not compile time. This means that if my assembly creates a generic list of Controls, and your assembly also creates a generic list of Controls, then both assemblies will share the same implementation. The consequences of this include a massive reduction in code bloat, not to mention the reduced load on the processor’s code cache.

Brad Adams has posted a short article to his blog detailing the use of Reflection to see how Generics are actually implemented. Interesting stuff.


blog comments powered by Disqus

Next Post
How important is assembly language  07 Feb 2004
Prior Post
No more Applications  18 Jan 2004
Related Posts
When (not) to use Var  16 Jul 2016
Semantic Types Redux  05 Jun 2016
Semantic Types in C#6  27 May 2016
Property Enhancements for C#  20 Dec 2015
Language Extensions for C#  19 May 2014
When should methods be Static?  09 Oct 2012
Of Method Naming and more  29 Sep 2012
Someone needs an intervention  16 Dec 2011
CallerInfo in C# 5  08 Dec 2011
Regions in C#  16 May 2011
More csharp posts »
Related Pages
January 2004 archive