C# in Depth, Fourth Edition
Jon Skeet
  • MEAP began March 2017
  • Publication in Spring 2018 (estimated)
  • ISBN 9781617294532
  • 375 pages (estimated)
  • printed in black & white


An eBook copy of the previous edition, C# in Depth, Third Edition, is included at no additional cost. It will be automatically added to your Manning Bookshelf within 24 hours of purchase.

C# is an amazing language that's up to any challenge you can throw at it. As a C# developer, you also need to be up to the task. C# in Depth, Fourth Edition is your key to unlocking the powerful new features added to the language in C# 5, 6, and 7. Following the expert guidance of C# legend Jon Skeet, you'll master asynchronous functions, expression-bodied members, interpolated strings, tuples, and much more.
Table of Contents detailed table of contents

Part 1: Introduction

1. Survival of the sharpest

2. Greatest hits of C# 2-4

Part 2: C# 5

3. Using asynchronous functions — including removal of await restrictions in C# 6

4. Exploring the async details — including custom awaitables in C# 7

5. C# 5 bonus features

Part 3: C# 6

6. Super-sleek properties and expression-bodied members

6.1. A brief history of properties

6.2. Upgrades to automatically implemented properties

6.2.1. Read-only automatically implemented properties

6.2.2. Initializing automatically implemented properties

6.2.3. Automatically implemented properties in structs

6.3. Expression-bodied members

6.3.1. Even simpler read-only computed properties

6.3.2. Expression-bodied methods, indexers and operators

6.3.3. Restrictions on expression-bodied members in C# 6

6.3.4. Guidelines for using expression-bodied members

6.4. Summary

7. Stringy features

7.1. A recap on string formatting in .NET

7.1.1. Simple string formatting

7.1.2. Custom formatting with format strings

7.1.3. Localization

7.2. Introducing interpolated string literals

7.2.1. Simple interpolation

7.2.2. Format strings in interpolated string literals

7.2.3. Interpolated verbatim string literals

7.2.4. Compiler handling of interpolated string literals (part 1)

7.3. Localization using FormattableString

7.3.1. Compiler handling of interpolated string literals (part 2)

7.3.2. Formatting a FormattableString in a specific culture

7.3.3. Other uses for FormattableString

7.3.4. Using FormattableString before with older versions of .NET

7.4. Uses, guidelines and limitations

7.4.1. Developers and machines, but maybe not end users

7.4.2. Hard limitations of interpolated string literals

7.4.3. When you can, but really shouldn't

7.5. Accessing identifiers with nameof

7.5.1. Common uses of nameof

7.5.2. Extra details

7.6. Summary

8. A smörgåsbord of features for concise code

8.1. "Using static" directives

8.1.1. Importing static members

8.1.2. Extension methods and using static

8.2. Object and collection initializer enhancements

8.2.1. Indexers in object initializers

8.2.2. Using extension methods in collection initializers

8.2.3. Test code vs production code

8.3. The null conditional operator

8.3.1. Simple and safe property dereferencing

8.3.2. The null conditional operator in more detail

8.3.3. Handling Boolean comparisons

8.3.4. Indexers and the null conditional operator

8.3.5. Working effectively with the null conditional operator

8.3.6. Limitations of the null conditional operator

8.4. Exception filters

8.4.1. Syntax and semantics of exception filters

8.4.2. Retrying operations

8.4.3. Logging as a side-effect

8.4.4. Individual, case-specific exception filters

8.4.5. Why not just throw?

8.5. Summary

Part 4: C# 7 and beyond

9. Composition using tuples

9.1. Introduction to tuples

9.2. Tuple literals and tuple types

9.2.1. Syntax

9.2.2. Tuples as bags of variables

9.3. Tuple types and conversions

9.3.1. Inferred types of tuple literals

9.3.2. Conversions from tuple literals to tuple types

9.3.3. Conversions between tuple types

9.3.4. Uses of conversions

9.3.5. Element name checking in inheritance

9.4. Tuples in the CLR

9.4.1. Introducing System.ValueTuple<…​>

9.4.2. Element name handling

9.4.3. Tuple conversion implementations

9.4.4. String representations of tuples

9.4.5. Regular equality and ordering comparisons

9.4.6. Structural equality and ordering comparisons

9.4.7. Womples and large tuples

9.4.8. The non-generic ValueTuple struct

9.4.9. Extension methods

9.5. Alternative options

9.5.1. System.Tuple<…​.>

9.5.2. Anonymous types

9.5.3. Named types

9.6. Uses and recommendations

9.6.1. Non-public APIs and easily-changed code

9.6.2. Local variables

9.6.3. Fields

9.6.4. Tuples and dynamic don't play together nicely

9.7. Summary

10. Decomposition

11. TBD

12. The future


Appendix A: features by language and framework versions

About the Technology

If you're a .NET developer, you'll use C# whether you're building an advanced enterprise application or just pushing out a quick ASP.NET app. C# 5, 6 and 7 have added a host of new features to help you write better code with tuples, string interpolation, pattern matching, and more. To really succeed with these powerful new features, however, you need to learn them in depth. This book is your ticket!

What's inside

  • The latest changes and updates for C# 5, 6, and 7
  • How C# works and why
  • Using asynchronous functions
  • Simpler string formatting with interpolation
  • Composition with tuples
  • Decomposition and pattern matching

About the reader

If you're a C# developer who's comfortable working with the language and wants to really dig in deep, then this book is for you.

About the author

Jon Skeet is a senior software engineer at Google. He studied mathematics and computer science at Cambridge, is a recognized authority in Java and C#, and maintains the position of top contributor to Stack Overflow.

Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
MEAP combo $49.99 pBook + eBook
MEAP eBook $39.99 pdf + ePub + kindle

FREE domestic shipping on three or more pBooks