Endjin - Home

Why You Should Buy My Book: Programming C# 8.0

by Ian Griffiths

Programming C# 8.0

TL;DR: buy my book! Programming C# 8.0, from O’Reilly. (E.g., from Amazon UK 🇬🇧, Amazon.com 🇺🇸 or Amazon India 🇮🇳)

There can no longer be any doubt. My first copy turned up a while ago:

Programming C# 8.0 (a book)

Then the big box of extra copies turned up this week:

A box full of copies of Programming C# 8.0

And other people seem to have been receiving copies too. (Some of them got theirs before me! Including the people living at my old home address from 3 years ago, apparently, thanks to an extraordinarily flexible interpretation of “eventual consistency” in someone’s record keeping system.)

That can mean only one thing: it’s time for an act of blatant self-promotion.

I spent a big chunk of last year writing an update to Programming C#, published by O’Reilly. Examples downloadable from https://github.com/idg10/prog-cs-8-examples. (A huge Thank You to endjin for letting me make space in my schedule for this.) This was a pretty hefty effort because for various reasons, the previous edition was from way back in the days of C# 5! (I did write about 2/3 of a C# 6 update in 2016, but due to an particular combination of events in my work life, my home life, and staff changes at O’Reilly, that did not see the light of day.) The world of .NET has changed pretty dramatically since then thanks to Microsoft’s shift to open source, and .NET Core’s wholehearted embrace of a multi-platform world.

So even if C# itself hadn’t changed much, the book would have needed a thorough update. Every chapter was affected by the shift towards .NET Core as the foundation for C#’s future.

But of course, C# has changed. Looking through the research notes I made while writing the book, I see there have been over 50 changes to the language since the previous edition. Some are pretty small, such as the ability to use digit separators in numeric constants (no more off-by-one-order-of-magnitude problems—instead of writing 10000000 you can write 10_000_000), some cluster together to form related sets of new feature such as pattern matching, and on the more radical end of the spectrum we have the new Nullable References feature. Or to be more precise, we finally have support for non-nullable references to go along with the nullable references we’ve always had, but for various reasons, Microsoft has named the feature after the thing we already had and not the new thing.

(If you want to find out why Microsoft made this odd naming decision, you could either buy my book or come along to my talk, C#8 Nullable References in Practice, at the .NET Oxford user group on 10th March 2020. Better yet, do both!)

Now there are those who would ask: why write a book in this day and age? What’s the point when you can find all the information you could want by searching the internet?

Why, to put it more bluntly, should you buy my book?

And you definitely should buy my book.

Books continue to be my preferred source of learning because nothing else offers the combination of depth, breadth, and coherence. You can certainly find depth on the internet. If you wanted to learn some very particular details about how C# 8.0’s new positional patterns relate to desconstruction, and how discards fit into all of this you could do much worse than read my series of posts on that very topic from last year. There is depth there and, I hope, coherence, but not very much breadth. Those arose from some research I was doing while writing the book, and I posted them because I thought they were interesting, but they have a very narrow focus.

And that’s the problem with a lot of what’s on the internet. If you want to learn the basics about pretty much anything you can probably find something on the internet. But if you’re looking to learn something big, and you want anything more than the basics, that’s when articles on the web start to fall short. You might easily find 100 near-identical introductions, each slightly wrong in their own way, and a handful of esoteric articles going into extreme depth on something in particular. But what’s often missing is a detailed answer to these questions: what does this technology offer and how do I use it? A problem with trying to search for stuff on the internet is that you can end up with hundreds of gaps, and no real idea of what those gaps are. One of the most important aspects of a technical author’s job is to work out what to talk about and in what order. It’s one of those tasks which, if you do it right, will make it seem like nothing has been done at all, as it should all seem effortless and obvious, but as with most worthwhile endeavours, to make something look effortless requires an incredible amount of work.

It’s true that a lot of online courses do a reasonably good job in this respect. For example, my Pluralsight courses, WPF Fundamentals, WPF Advanced Topics and What’s new in WPF v4 (I told you this blog was all about blatant self-promotion) provide a better combination of breadth, depth, and coherence than you’ll get by searching out random articles about WPF on the internet. But those courses are on a significantly smaller scale than a book (which is why I also cowrote a couple of editions of Programming WPF back in the day). There’s nothing quite like a book if you want thorough coverage.

My goal with Programming C# 8.0 (and its predecessors) was very clear: I wanted to write the book that I would want to read. It is intended for experienced developers—it makes no attempt to teach the basics of programming. Instead its goal is to provide someone who already knows at least one programming language as complete a view as possible of what C# can do and how you can best use it. It is my attempt to distil around 18 years of experience with C# (part of almost 30 years of work as a programmer) into a coherent, complete description of what you’ll need to know to be productive today in C#.

About the author

Ian started using computers when he was six. He has worked in various aspects of computing, including computer networking, embedded real-time systems, broadcast television systems, medical imaging, and all forms of cloud computing. He is a Technical Fellow at endjin, You can follow him on Twitter via @idg10