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
Agile Development - The People Factor  04 Feb 2004
Prior Post
No more Applications  18 Jan 2004
Related Posts
Using Constructors  27 Feb 2023
An Inconvenient API  18 Feb 2023
Method Archetypes  11 Sep 2022
A bash puzzle, solved  02 Jul 2022
A bash puzzle  25 Jun 2022
Improve your troubleshooting by aggregating errors  11 Jun 2022
Improve your troubleshooting by wrapping errors  28 May 2022
Keep your promises  14 May 2022
When are you done?  18 Apr 2022
Fixing GitHub Authentication  28 Nov 2021
Archives
January 2004
2004