13.07.2015 Views

C# in Depth

C# in Depth

C# in Depth

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Cutt<strong>in</strong>g fluffwith a smart compilerThis chapter covers■■■■■Automatically implemented propertiesImplicitly typed local variablesObject and collection <strong>in</strong>itializersImplicitly typed arraysAnonymous typesWe start look<strong>in</strong>g at <strong>C#</strong> 3 <strong>in</strong> the same way that we f<strong>in</strong>ished look<strong>in</strong>g at <strong>C#</strong> 2—with acollection of relatively simple features. These are just the first small steps on thepath to LINQ, however. Each of them can be used outside that context, but they’reall pretty important for simplify<strong>in</strong>g code to the extent that LINQ requires <strong>in</strong> orderto be effective.One important po<strong>in</strong>t to note is that while two of the biggest features of <strong>C#</strong> 2—generics and nullable types—required CLR changes, there are no significantchanges to the CLR that ships with .NET 3.5. There are some bug fixes, but noth<strong>in</strong>gfundamental. The framework library has grown to support LINQ, along with <strong>in</strong>troduc<strong>in</strong>ga few more features to the base class library, but that’s a different matter. It’s207Licensed to Rhona Hadida

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!