posted by Eugenia Loli on Sun 13th Nov 2005 20:15 UTC
Code once. Use many. That's what generics are about. Called templates in C++, C# generics support separating code by algorithm and data structure. For example, the generic list means that you'll never again have to write a strongly typed collection. Paul Kimmel shows just how easy it is to define and use generics, long considered one of the most advanced and difficult idioms. This article is adapted from Paul Kimmel's book C# Express.