C# in Depth, 3rd Edition
Jon Skeet
Language: English
Pages: 616
ISBN: 161729134X
Format: PDF / Kindle (mobi) / ePub
Summary
C# in Depth, Third Edition updates the best-selling second edition to cover the new features of C# 5, including the challenges of writing maintainable asynchronous code. It preserves the uniquely insightful look into the tricky areas and dusty corners of C# that only expert Jon Skeet can provide.
About this Book
If you're a .NET developer, you'll use C# whether you're building an advanced enterprise application or just slamming out a quick app. In C# 5, you can do amazing things with generics, lambda expressions, dynamic typing, LINQ, iterator blocks, and other features. But first you have to learn it in depth.
C# in Depth, Third Edition has been thoroughly revised to cover the new features of C# 5, including the subtleties of writing maintainable asynchronous code. You'll see the power of C# in action, learning how to work with high-value features that you'll be glad to have in your toolkit. And you'll learn to avoid hidden pitfalls of C# programming with the help of crystal clear explanations of "behind the scenes" issues.
This book assumes you've digested your first C# book and are hungry for more!
Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.
What's Inside
- Updated for C# 5
- The new async/await feature
- How C# works and why
About the Author
Jon Skeet is a Senior Software Engineer at Google, and a highly visible participant of newsgroups, user groups, international conferences, and the Stack Overflow Q&A site. Jon spends much of his day coding in Java, but his heart belongs to C#.
Table of Contents
- The changing face of C# development
- Core foundations: building on C# 1
- Parameterized typing with generics
- Saying nothing with nullable types
- Fast-tracked delegates
- Implementing iterators the easy way
- Concluding C# 2: the final features
- Cutting fluff with a smart compiler
- Lambda expressions and expression trees
- Extension methods
- Query expressions and LINQ to Objects
- LINQ beyond collections
- Minor changes to simplify code
- Dynamic binding in a static language
- Asynchrony with async/await
- C# 5 bonus features and closing thoughts
PART 1 PREPARING FOR THE JOURNEY
PART 2 C# 2: SOLVING THE ISSUES OF C# 1
PART 3 C# 3: REVOLUTIONIZING DATA ACCESS
PART 4 C# 4: PLAYING NICELY WITH OTHERS
PART 5 C# 5: ASYNCHRONY MADE SIMPLE
Beginning iPhone Development: Exploring the iOS SDK (7th Edition)
iPhone and iPad Apps for Absolute Beginners (4th Edition)
C++ Recipes: A Problem-Solution Approach
Eclipse Rich Client Platform (2nd Edition)
this.name = name; this.price = price; } public static List
ArrayList in .NET 1.1—but in .NET 2.0 it wouldn’t be crazy to do the same with a List
we’ll meet in chapter 9.) 130 Saying goodbye to awkward delegate syntax 131 C# 2 is a sort of stepping stone in terms of delegates. Its new features pave the way for the dramatic changes of C# 3, keeping developers reasonably comfortable while still providing useful benefits. I’m reliably informed that language designers were aware that the combined feature set of C# 2 would open up whole new ways of looking at code, but they didn’t necessarily know where those paths would lead. So far, their
white when you consider covariance and contravariance as applied to delegates. Suppose you have an event handling method that saves the current document, or just logs that it’s been called, or any number of other actions that may not need to know details of the event. The event itself shouldn’t mind that your method is capable of working with only the information provided by the EventHandler signature, even though it (the event) is declared to pass in mouse 132 CHAPTER 5 Fast-tracked
either less useful or less logical), but they also make it easy to produce horribly complicated code. Don’t let that discourage you from using them sensibly, though—they can save you masses of tedious code, and when they’re used appropriately they can be the most readable way of getting the job done. But what counts as sensible? GUIDELINES FOR USING CAPTURED VARIABLES The following is a list of suggestions for using captured variables: If code that doesn’t use captured variables is just as