How often have you wanted to reuse some code you previously wrote but it
didn't quite fit in your current project? Code reuse is an oft-touted benefit
of modern object-oriented programming. With the advent of generic support in
the C# language appearing in the .NET Framework 2.0 developers have new
leverage for writing code that can be reused without compromising type
safety.
About Type Safety
A key benefit to languages that support type checking is type safety. Type
safety at build time and/or runtime prevents code from manipulating data of
an incorrect type. As part of its type safe approach, C# detects type
mismatch errors at build time in the compiler and at runtime in the Common
Language Runtime (CLR). The following is a type mismatch error that C# will
catch at b... (more)