Beginning Visual C#supAND#174;/sup 2005

Overview

One of the (admittedly few) criticisms leveled against the first version of C# was its lack of support for generics. Generics in C++ (known as templates in that language) had long been regarded as an excellent way of doing things, allowing a single type definition to spawn a multitude of specialized types at compile time and thus saving an awful lot of time and effort. For whatever reason, generics didn't quite make it into the first release of C#, and the language suffered because of it. Perhaps this was so because generics are often seen as being quite difficult to come to grips with, or maybe it was decided that they weren't necessary. Thankfully though, with C# version 2.0 generics have come to join the party. And no, they aren't really that difficult to use, although they do require a slightly different way of looking at things. The end result of your efforts, though, will be richly rewarded!

In this chapter, you:

Категории