C# 6 for Programmers
How to Program SeriesThe professional programmer’s Deitel® guide to C# 6—Written for programmers with a background in high-level language programming, this book applies the Deitel signature live-code approach to teaching programming and explores Microsoft’s C# 6 and .NET in depth. Concepts are presented in the context of 170+ fully coded and tested apps, complete with syntax shading, code highlighting, code walkthroughs, program outputs and hundreds of savvy software-development tips.
Start with an introduction to C# using an early classes and objects approach, then rapidly move on to more advanced topics, including LINQ, asynchronous programming with async and await and more. You’ll enjoy the treatment of object-oriented programming and an object-oriented design/UML® ATM case study, including a complete C# implementation. When you’ve mastered the book, you’ll be ready to start building industrial-strength, object-oriented C# apps.
Source Code
Not a GitHub user? Download the ZIP file
Preface
View the Preface to learn about the book’s approach and features
Other Downloads
Table of Contents
View the full Table of Contents for each chapter’s coverage.
Buy the Book
Features
- Integrated coverage of C# 6 functionality: string interpolation, expression-bodied methods and properties, auto-implemented property initializers, getter-only properties, nameof, null-conditional operator, exception filters and more.
- Entertaining and challenging code examples.
- Deep treatment of classes, objects, inheritance, polymorphism and interfaces.
- Generics, LINQ and generic collections; PLINQ (Parallel LINQ) for multicore performance
- Asynchronous programming with async and await; functional programming with lambdas, delegates and immutability.
- Files; relational database with LINQ to Entities.
- Object-oriented design ATM case study with full code implementation.
- Emphasis on performance and software engineering principles.
Comments from Recent Editions Reviewers
“Takes you from zero to the highest levels of C# programming proficiency, preparing you to tackle the most frequent requirements in modern software development. The code examples really shine. The best presentation of inheritance, interfaces and polymorphism I’ve seen in my 30+ years as a trainer and consultant. I like the early introduction to LINQ and .NET collections, and the coverage of LINQ to Entities for relational databases. Shows the techniques needed to develop real-world apps, including key topics, such as async and await.”
—Octavio Hernandez, Microsoft Certified Solution Developer (MCSD), Principal Software Engineer at Advanced Bionics
“This book’s treatment of LINQ and PLINQ is excellent—I liked how it led naturally to functional programming idioms—skills that will serve professionals best for their future. Also, it was great to see performance testing on multicore systems.”
—Lucian Wischik, C# Language Design Team, Microsoft
“The ultimate book on programming with Microsoft technologies.”
—Kirill Osenkov, Visual Studio Languages Team, Microsoft
“Excellent introduction to the world of .NET for the beginning C# programmer, using the Deitels’ live-code approach and real-world examples.”
—Bonnie Berent, Microsoft C# MVP
“Illustrates the best practices of C# programming. Teaches how to ‘program in the large,’ with material on object-oriented programming and software engineering principles.”
—Mingsheng Hong, Cornell University
“I like the chapter on asynchronous programming with async and await—this is the future of programming, and making these types of tasks ‘easy’ to program is going to be key to any programming language. The introduction to multi-threading was interesting. It was good to see synchronous versus asynchronous programming head-to-head. The flickr web services demo was awesome.”
—Bradley Sward, College of Dupage
“I really love the way you guys write—it’s interesting and informative!”
—Shay Friedman, Microsoft Visual C# MVP
“Good introduction to the most popular GUI controls and working with events. I use the techniques of the strings chapter in the line of business apps that I build. I liked the files and streams chapter and the real-world example. I’m pleased to see the inclusion of additional advanced material online.”
—Shawn Weisfeld, Microsoft MVP and President and Founder of UserGroup.tv
“Outstanding presentations of Windows Forms and the .NET I/O facilities. Amazingly clear and intuitive presentation of generics; this chapter represents why I like this book so much—it really shines at presenting advanced topics in a way that can be easily understood. The presentation of LINQ to XML is fabulous.”
—Octavio Hernandez, Microsoft Certified Solution Developer (MCSD), Principal Software Engineer at Advanced Bionics
“The beginning of the chapter ‘Classes and Objects: A Deeper Look’ shows a class in an ‘amateur’ state—then you do a great job of describing how many ways one can improve it until it pretty much becomes air-tight in security and functionality. Operator overloading is a good description. Good example of extension methods.”
—Bradley Sward, College of Dupage
“Updating an already excellent book with the latest .NET features can only result in a superb product. I like the explanation of properties and the discussion of value vs. reference types. I like your explanation of pass-by-value vs. pass-by-reference. The arrays chapter is one of my favorites. Great job explaining inheritance, polymorphism, interfaces and operator overloading.”
—José Antonio González Seco, Parliament of Andalusia, Spain
“Great job explaining exception handling—with great examples; the new features look pretty sweet. Shows the important things you need to get going with GUI. Delegates are huge and covered well. Interesting description of C# 6’s exception filters.”
—Bradley Sward, College of Dupage
“An excellent introduction to XML, LINQ to XML and related technologies.“
—Helena Kotas, Microsoft
“Good overview of relational databases—it hits on the right LINQ idioms. “
—Alex Turner, Microsoft
“Excellent chapter on exceptions. “
—Vinay Ahuja, Architect, Microsoft Corporation
“Great chapter on polymorphism. “
—Eric Lippert, Formerly of Microsoft
“Introduction to LINQ and the List Collection is a great chapter; you do such a good and consistent job of explaining your code. The focus on using LINQ to manage data is cutting edge.”
—Stephen Hustedde, South Mountain College
“The presentations are always superbly clear. Excellent intro to Visual Studio and visual programming! I like the early presentation of the new C# 6 string interpolation feature. Introducing UML class diagrams in parallel with the presentation of the language is a great idea. I like the early introduction of exception handling. Brings readers up to speed fast in GUI design and implementation, and event-driven programming. Nice example demonstrating the method call stack and activation records. Database chapter perfectly explains LINQ to Entities and UI binding.”
—Octavio Hernandez, Microsoft Certified Solution Developer (MCSD), Principal Software Engineer at Advanced Bionics
“Chapter 2 is perfect for introducing Visual Studio and GUI elements—I wish I had this chapter when I was first getting back into computers. Everything felt just right in the methods chapter. Recursion will warp anyone’s brain—the stack discussion really helps readers understand what is going on. I really like the deck of cards example, being a former casino gaming programmer. Multidimensional arrays are handled well. I like the attention to detail and the UML. Thank you for showing correct code-formatting conventions. Thorough display of all the ‘pass-by’ types. The card shuffling and dealing simulation is a great example for bringing together many concepts. Good use of overloaded functions for rectangular arrays and jagged arrays. The LINQ chapter is perfect—much more will be revealed in later chapters but readers will remember this. The collections are a nice addition as well—a chapter that is important to get a taste of now so the later material can be feasted upon. Describes inheritance perfectly.”
—Bradley Sward, College of Dupage
“This new edition solidifies it as the fundamental tool for learning C# updated to the latest C# 6 features. It covers from the fundamentals of OOP to the most advanced topics, all in an easily accessible way thanks to its crystal-clear explanations. A good job explaining such a complex topic as asynchronous programming.”
—José Antonio González Seco, Parliament of Andalusia, Spain
“I liked the natural use of C# 6 string interpolation. A good clear explanation of LINQ query syntax. GUI apps are where coding starts to become fun—you’ve handled it well and covered all the bases. The Game of Craps is an awesome example. I love that you’re paying attention to formats and using them well.”
—Lucian Wischik, C# Language Design Team, Microsoft
“An excellent resource to tame the beast that is C#. In the Windows forms chapter, cool how the message box will be customized to the clicked buttons. I love the Paint example. A good look at files and directories—with text mode it’s easier to see what’s going on—binary mode is much more efficient so it’s good to see it here. You show error checking in GUI and files/streams well. File chooser functionality is a nice touch. Good example of serialization. The recursive directory searching is nice.”
—Bradley Sward, College of Dupage
Share This Page