A Programmer's Guide to C# 5.0 [electronic resource] /
Gunnerson, Eric.author.
Wienholt, Nick.author.
A Programmer's Guide to C# 5.0 is a book for software developers who want to truly understand C#. Whether you've worked with C# before or with another general-purpose programming language, each fast-paced, focused chapter will take you straight to the heart of a feature of C# and show you why it works the way it does. Written by one-time C# Test Lead, Program Manager, and member of the original C# language design team, this book is an ideal companion to the C# Language Specification, and works both as a tutorial and as a reference guide. Now in its fourth edition, you will find up-to-date coverage of all the latest C# features, including Linq, covariance and contravariance, and async support. You'll learn how to: Use C# features effectively, in the way they were intended Apply the newest C# features to your coding problems Streamline your database code using LINQ Use async support and the task parallel library to improve performance. Program more efficiently, effectively, and with real insight into this mature and exciting language, with A Programmer's Guide to C# 5.0.
Title Page; Copyright Page; Dedication Page; Contents at a Glance; Table of Contents; Preface; About the Author; About the Technical Reviewer; Acknowledgments; Introduction; Who This Book Is For; How This Book Is Structured; Downloading the Code; Contacting the Author; Chapter 1 C# and the .NET Runtime and Libraries; Chapter 2 C# QuickStart and Developing in C#; Hello, Universe; Namespace and Using Statements; Namespaces and Assemblies; Basic Data Types; Classes, Structs, and Interfaces; Statements; Enums; Delegates and Events; Properties and Indexers; Attributes; Developing in C#
Tools of NoteILDASM; Decompilers; Obfuscators; NGEN; Chapter 3 Classes 101; A Simple Class; Member Functions; ref and out Parameters; Overloading; Chapter 4 Base Classes and Inheritance; The Engineer Class; Simple Inheritance; Arrays of Engineers; Virtual Functions; Abstract Classes; Sealed Classes and Methods; Chapter 5 Exception Handling; What's Wrong with Return Codes?; Trying and Catching; Choosing the Catch Block; Passing Exceptions on to the Caller; Caller Beware; Caller Confuse; Caller Inform; User-Defined Exception Classes; Finally; Top-Level Exception Handlers
Efficiency and OverheadDesign Guidelines; Exceptions Are Exceptional; Choosing the Right Exception for Wrapping; Exceptions Should be as Specific as Possible; Retry Logic; Rethrowing; Catch Only if You Have Something Useful to Do; Chapter 6 Member Accessibility and Overloading; Class Accessibility; Using Internal on Members; Expanding Internal Accessibility; Protected; Internal Protected; The Interaction of Class and Member Accessibility; Accessability Summary; Method Overloading; Method Hiding; Better Conversions; Variable-Length Parameter Lists; Default Arguments; Named Arguments
Chapter 7 Other Class DetailsNested Classes; Other Nesting; Anonymous Types; Creation, Initialization, Destruction; Constructors; Private Constructors; Initialization; Destructors; Managing Nonmemory Resources; IDisposable and the Using Statement; IDisposable and Longer-Lived Objects; Static Fields; Static Member Functions; Static Constructors; Constants; Read-Only Fields; Extension Methods; Usage Guidelines; Object Initializers; Static Classes; Partial Classes and Methods; Chapter 8 Structs (Value Types); A Point Struct; Boxing and Unboxing; Structs and Constructors; Mutable Structs
Design GuidelinesImmutable Classes; Chapter 9 Interfaces; A Simple Example; Working with Interfaces; The as Operator; Interfaces and Inheritance; Design Guidelines; Multiple Implementation; Explicit Interface Implementation; Implementation Hiding; Interfaces Based on Interfaces; Interfaces and Structs; Chapter 10 Versioning and Aliases; A Versioning Example; Coding for Versioning; Type Aliases; External Assembly Aliases; Chapter 11 Statements and Flow of Execution; Selection Statements; If; Switch; Iteration Statements; While; Do; For; Foreach; Jump Statements; Break; Continue; Goto; Return
Other Statements
Includes index.
A Programmer's Guide to C# 5.0 is a book for software developers who want to truly understand C#. Whether you've worked with C# before or with another general-purpose programming language, each fast-paced, focused chapter will take you straight to the heart of a feature of C# and show you why it works the way it does. Written by one-time C# Test Lead, Program Manager, and member of the original C# language design team, this book is an ideal companion to the C# Language Specification, and works both as a tutorial and as a reference guide. Now in its fourth edition, you will find up-to-date coverage of all the latest C# features, including Linq, covariance and contravariance, and async support. You'll learn how to: Use C# features effectively, in the way they were intended Apply the newest C# features to your coding problems Streamline your database code using LINQ Use async support and the task parallel library to improve performance. Program more efficiently, effectively, and with real insight into this mature and exciting language, with A Programmer's Guide to C# 5.0.
Microsoft software.
Microsoft .NET Framework.
Software engineering.
Microsoft and .NET.
Software Engineering/Programming and Operating Systems.