-
Book Overview & Buying
-
Table Of Contents
.NET 4.0 Generics Beginner's Guide
By :
My objective for this chapter was to make sure you get why Generics is important. Following are the points again in bullets:
It ensures compile-time type checking, so type safety is ensured.
It can yield the right code for the data type thrown at it at runtime, thus saving us a lot of typing.
It is very fast (about seven times) compared to its non-generic cousins for value types.
It is everywhere in the .NET ecosystem. API/framework developers trust the element of least surprise and they know people are familiar with Generics and their syntax. So they try to make sure their APIs also seem familiar to the users.
In the end, we did an initial setup of the environment; so we are ready to build and run applications using .NET Generics. From the next chapter, we shall learn about .NET Generic containers and classes. In the next chapter, we shall discuss the Generic container List<T> that will let you store any type of data in a type safe way. Now that you know that's important, let's go there.
Change the font size
Change margin width
Change background colour