Table of contents:THROUGHOUT THE HISTORY of software engineering, the methodology used to write computer programs has undergone several paradigm shifts, each building on the foundation of the former by increasing code organization and decreasing complexity. This book takes you through these same paradigm shifts.
The beginning chapters take you through sequential programming structure, in which statements are written in the order in which they are executed. The problem with this model is that complexity increases exponentially as the requirements increase. To reduce this complexity, code blocks are moved into methods, creating a structured programming model. This allows you to call the same code block from multiple locations within a program, without duplicating code. Even with this construct, however, programs quickly become unwieldy and require further abstraction. Object-oriented programming, discussed in Chapter 5, was the response. In subsequent chapters, you will learn about additional methodologies, such as interface-based programming, LINQ (and the transformation it makes to the collection API), and eventually rudimentary forms of declarative programming (in Chapter 17) via attributes.
This book has three main functions.
1. It provides comprehensive coverage of the C# language, going beyond a tutorial and offering a foundation upon which you can begin effective software development projects.
2. For readers already familiar with C#, this book provides insight into some of the more complex programming paradigms and provides indepth coverage of the features introduced in the latest version of the language, C# 4.0 and .NET Framework 4.
3. It serves as a timeless reference, even after you gain proficiency with the language.
The key to successfully learning C# is to start coding as soon as possible. Don’t wait until you are an “expert” in theory; start writing software immediately. As a believer in iterative development, I hope this book enables even a novice programmer to begin writing basic C# code by the end of Chapter 2.
A number of topics are not covered in this book. You won’t find coverage of topics such as ASP.NET, ADO.NET, smart client development, distributed programming, and so on. Although these topics are relevant to the .NET Framework, to do them justice requires books of their own. Fortunately, Addison-Wesley’s .NET Development Series provides a wealth of writing on these topics. Essential C# 4.0 focuses on C# and the types within the Base Class Library. Reading this book will prepare you to focus on and develop expertise in any of the areas covered by the rest of the series.
Code: Select all
1 Introducing C# 1 2 Data Types 31 3 Operators and Control Flow 83 4 Methods and Parameters 149 5 Classes 201 6 Inheritance 269 7 Interfaces 305 8 Value Types 331 9 Well-Formed Types 357 10 Exception Handling 405 11 Generics 421 12 Delegates and Lambda Expressions 469 13 Events 507 14 Collection Interfaces with Standard Query Operators 535 15 LINQ with Query Expressions 589 16 Building Custom Collections 611 17 Reflection, Attributes, and Dynamic Programming 651 18 Multithreading 701 19 Synchronization and More Multithreading Patterns 749 20 Platform Interoperability and Unsafe Code 815 21 The Common Language Infrastructure 843 A Downloading and Installing the C# Compiler and the CLI Platform 865 B Full Source Code Listings 869 C Concurrent Classes from System. Collections. Concurrent 895 D C# 2.0 Topics 899 E C# 3.0 Topics 903 F C# 4.0 Topics 905
Essential-C#-4.0.pdf [4.53 Mb]