Some view the syntactic constructs introduced by generics as a welcome addition to the language. This crowd looks at the type arguments that accompany a generic declaration and sees them as providing a very precise, undeniably clear definition of each data type. For them, generics eliminate any confusion that might have been associated with using non-generic APIs.
Meanwhile, another population views generics as imposing on the readability of their code. They see type parameters and constraints and new keywords as muddying the image of what was an otherwise perfectly clean, uncluttered block of code. Many in this group see generics as undermining the general usability and maintainability of their code.
The challenge here is striking a balance between these two groups. If everyone can agree on the general value of generics, the only issue that remains is how to introduce them without creating code that is so confusing that it requires a decoder ring to decipher the text. The goal of this section is to offer up some guidelines that can establish some fundamental boundaries that give developers the freedom to leverage generics without leaving behind a trail of unreadable code.
During the beta cycle for Visual Studio 2005, early adopters focused a significant portion of venom and debate on naming conventions for type parameters. Because type parameters are littered throughout ...