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.

Part 3<strong>C#</strong> 3—revolutioniz<strong>in</strong>ghow we codeThere is no doubt that <strong>C#</strong> 2 is a significant improvement over <strong>C#</strong> 1. The benefitsof generics <strong>in</strong> particular are fundamental to other changes, not just <strong>in</strong> <strong>C#</strong> 2but also <strong>in</strong> <strong>C#</strong> 3. However, <strong>C#</strong> 2 was <strong>in</strong> some sense a piecemeal collection of features.Don’t get me wrong: they fit together nicely enough, but they address a setof <strong>in</strong>dividual issues. That was appropriate at that stage of <strong>C#</strong>’s development, but<strong>C#</strong> 3 is different.Almost every feature <strong>in</strong> <strong>C#</strong> 3 enables one very specific technology: LINQ.Many of the features are useful outside this context, and you certa<strong>in</strong>ly shouldn’tconf<strong>in</strong>e yourself to only us<strong>in</strong>g them when you happen to be writ<strong>in</strong>g a queryexpression, for example—but it would be equally silly not to recognise the completepicture created by the set of jigsaw puzzle pieces presented <strong>in</strong> the rema<strong>in</strong><strong>in</strong>gchapters.I’m writ<strong>in</strong>g this before <strong>C#</strong> 3 and .NET 3.5 have been fully released, but I’d liketo make a prediction: <strong>in</strong> a few years, we’ll be collectively kick<strong>in</strong>g ourselves for notus<strong>in</strong>g LINQ <strong>in</strong> a more widespread fashion <strong>in</strong> the early days of <strong>C#</strong> 3. The buzzaround LINQ—both with<strong>in</strong> the community and <strong>in</strong> the messages from Microsoft—has been largely around database access and LINQ to SQL. Now databases are certa<strong>in</strong>lyimportant—but we manipulate data all the time, not just from databases but<strong>in</strong> memory, and from files, network resources, and other places. Why shouldn’tother data sources get just as much benefit from LINQ as databases?Licensed to Rhona Hadida

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

Saved successfully!

Ooh no, something went wrong!