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.

Comments

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
Equality has Symmetry  17 Mar 2018
Type Miscellany  05 Mar 2017
Testing Immutable Types  25 Feb 2017
Factory Methods  18 Feb 2017
Queue Concatenation  11 Feb 2017
Complex Queues  04 Feb 2017
The Problem with the Simple Queue  28 Jan 2017
Enumeration of Queues  21 Jan 2017
Reversing Stacks  14 Jan 2017
Simple Queues  07 Jan 2017
More csharp posts »
Archives
January 2004
2004