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
Short-circuiting validation  11 Aug 2018
Aggregation of validation  04 Aug 2018
Recovery of validation types  28 Jul 2018
Basic validation  21 Jul 2018
Why we need better validation  07 Jul 2018
A question of struct performance  30 Jun 2018
Equality has Symmetry  17 Mar 2018
Type Miscellany  05 Mar 2017
Testing Immutable Types  25 Feb 2017
Factory Methods  18 Feb 2017
More csharp posts »
Archives
January 2004
2004