You are previewing C# in Depth, Second Edition.

C# in Depth, Second Edition

Cover of C# in Depth, Second Edition by Jon Skeet Published by Manning Publications

Chapter 8. Cutting fluff with a smart compiler

This chapter covers

  • Automatically implemented properties
  • Implicitly typed local variables
  • Object and collection initializers
  • Implicitly typed arrays
  • Anonymous types

We start looking at C# 3 in the same way that we finished looking at C# 2—with a collection of relatively simple features. These are just the first small steps on the path to LINQ. Each of them can be used outside that context, but almost all are important for simplifying code to the extent that LINQ requires in order to be effective.

One important point to note is that though two of the biggest features of C# 2—generics and nullable types—required CLR changes, there were no significant changes to the CLR that shipped with .NET ...

The best content for your career. Discover unlimited learning on demand for around $1/day.