Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Ian Griffiths

Rating No ratings yet

C# is undeniably one of the most versatile programming languages available to engineers today. With this comprehensive guide, you'll learn just how powerful the combination of C# and .NET can be. Author Ian Griffiths guides you through C# 10.0 and .NET 6 fundamentals and techniques for building cloud, web, and desktop applications. Designed for experienced programmers, this book provides many code examples to help you work with the nuts and bolts of C#, such as generics, LINQ, and asynchronous programming features. You'll get up to speed on .NET 6 and the latest C# 9.0 and 10.0 additions, including records, enhanced pattern matching, and new features designed to remove "ceremony" to improve productivity. • Understand how .NET has changed in the most recent releases, and learn what it means for application development • Select the most appropriate C# language features for any task • Learn when to use the new features and when to stick with older ones • Examine the range of functionality available in .NET's class libraries • Learn how you can apply these class libraries to practical programming tasks • Explore numerous small additions to .NET that improve expressiveness "Unlike books that focus on Visual Studio and technologies that interact with C#, this one covers the core language, and mastery of this core is essential to successfully building good software. It covers important concepts followed by generous code examples to explain them. It's thorough, detailed, and gets at the nooks and crannies of the language rarely covered elsewhere. It's a complete course on C#." -- Jeremy Morgan, Software/DevOps engineer

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A thorough, example-driven course on the C# language itself—not the tooling around it—for experienced programmers who want to master C# 10 and .NET 6 fundamentals well enough to build cloud, web, and desktop applications with confidence. 【Book Arc】 - **Opening (~0%–10%)**: Sets up the book's philosophy and a working environment. The author deliberately covers the core language rather than Visual Studio, and the opening walks through creating a small project with tests first, establishing the hands-on, example-heavy style used throughout. - **Early (~10%–30%)**: Builds the language bedrock—static typing, variable declarations and identifiers, numeric types (including why `decimal` exists alongside `float`/`double`), expression statements, and the beginnings of pattern matching (positional, property, discard patterns). - **Early–Middle (~25%–40%)**: Moves into type design: static classes and `using static`, value types versus references (and the persistent stack-allocation myth), records and copy constructors, constructor chaining, and `in` parameters with their performance traps. - **Middle (~40%–50%)**: Covers members and abstraction—auto-properties with initializers, interfaces and explicit implementation, and the entry point into generics with generic classes and records. - **Late (beyond ~50%)**: The excerpts do not cover this portion; based on the blurb, later material addresses generics in depth, LINQ, asynchronous programming, and applying .NET class libraries to practical cloud, web, and desktop tasks. 【Key Takeaways】 - **This book teaches the language, not the IDE** (Opening): The author explicitly positions it against books focused on Visual Studio and surrounding technologies, arguing that core-language mastery is what makes good software possible. (Opening) - **Test-first is modeled, not just mentioned** (Opening): The first project is built by writing a unit test class before the code under test, with a scenario-per-class naming style rather than one test class per production class. (Opening) - **Static typing shapes everything** (Early): Types are fixed at compile time, unlike JavaScript; identifier rules, initializers, and declaration forms all follow from this foundation. (Early) - **`decimal` exists because binary floating point cannot represent money** (Early): Repeatedly adding 0.1 to a `float` yields ~0.9000001, so financial calculations need the 128-bit decimal type with predictable decimal precision. (Early) - **Culture affects runtime number formatting** (Early): Digit grouping and decimal separators vary by locale, so code that serializes data over a network may need to force specific conventions rather than rely on thread culture. (Early) - **Value types are not "the stack"** (Early–Middle): The stack-allocation claim is called out as a persistent myth; value instances can reuse memory and are not always stack-allocated, while reference types always allocate heap blocks. (Early–Middle) - **`in` parameters can silently fail to help** (Middle): The optimization only avoids copies when the struct is `readonly`; a mutable struct like `System.Windows.Rect` compiles and runs correctly but delivers no performance benefit. (Middle) - **Explicit interface implementation resolves collisions** (Middle): When two interfaces demand the same signature with different behavior—or an interface member would pollute a class's API—explicit implementation keeps members non-public. (Middle) 【Reading Tips】 - **Deep-read the type-system chapters** (value vs. reference, records, constructors, `in` parameters): these are where the author's "nooks and crannies" value is highest and where subtle bugs originate. - **Skim the environment setup and VS Code mechanics** (preview tabs, project creation) if you already have a working C# toolchain; return only for the test-project workflow. - **Type the examples rather than reading them**: the book's pedagogy is code-first, and several traps (floating-point drift, defensive copies) only land when you run them. - **Watch for the "when not to use the new feature" framing**: the blurb promises guidance on when to stick with older constructs—treat those passages as decision rules, not trivia. - **Use the pattern-matching material as a reference**: positional, property, and discard patterns are introduced incrementally and reward re-reading once you meet them in real code. 【Coverage Limits】 The excerpts cover roughly the first half of the book—language fundamentals through generics—so this guide cannot describe the LINQ, async, and application-building chapters in detail. Claims about the book's later structure come from the blurb, not from excerpted content.
Page 19
ntime. The prototype compiled this into code that generated the completed XML at runtime. Microsoft Research demonstrated this publicly, but this feature did...
View in text
Excerpt 2
can be represented completely accurately. This isn’t always instantly obvious, because when floating-point numbers are converted to text, they are rounded to...
View in text
Excerpt 3
to enable annotations anywhere to begin with. Since all of your references will be deemed oblivious to nullability checking, the only warnings you’ll see wil...
View in text
Excerpt 4
{ public string Name { get; set; } ...etc } When we implement an interface in C#, we typically define each of that interface’s methods as a public member of...
View in text
Excerpt 5
lp. There is direct language-level support for implementing IEnumerable<T>, and the runtime libraries provide support for the generic and nongeneric list int...
View in text
Excerpt 6
ber exceeds a threshold, generation 1 will be collected too. Generation 2 works in the same way. The thresholds are not documented, and in fact they’re not e...
View in text
Excerpt 7
of a reusable library, this is a common feature. Example 8- 13 shows a hypothetical example that offers various constructors, along with an enumeration type...
View in text
Excerpt 8
CustomLinqProvider performed each operation immediately—the Where and Select methods both returned fully populated arrays. LINQ to Objects does something qui...
View in text
Tags
AI categories
Programming LanguageC++C#
ISBN: 1098117816
Publisher: O'Reilly Media
Publish Year: 2022
Language: English
Pages: 800
File Format: PDF
File Size: 5.7 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…