Finally, I can properly talk about what I’ve been working on for about the last 6 months. The book I’ve been writing is called “C# in Depth” and it’s being published by Manning (just like Groovy in Action was). It’s about C# 2 and 3, and pretty much just C# 2 and 3. In particular, it’s aimed at people who already know C# 1 at least reasonably well. I believe there are plenty of people who are comfortable with C# 1 but either don’t know C# 2 at all or are familiar with it but have gaps in their experience. It’s for these people (hopefully many of whom are reading this blog!) that I’ve been writing.
I don’t know whether there are other books in progress in the same vein. I strongly suspect there will be several books which cover C# from scratch – and end up either skimping on detail, or being unliftable tomes. There may be some books which cover just C# 3 – which will make them less useful for developers who may not get to use C# 3 for a while, or don’t have enough C# 2 experience to fully appreciate C# 3.
Anyway, the first few chapters are now available in MEAP (Manning Early Access Program) at the C# in Depth website. The first chapter is available free, and you can get hold of the others by paying for either the e-book or the hard copy now. Obviously you won’t get the hard copy until it’s published, but you’ll get the electronic version as it gets updated, chapter by chapter. Here’s a quick rundown of the chapters which are available so far:
Chapter 1 – The changing face of C# development
This chapter is mostly introductory material, as you’d expect. There’s an outline and examples of some of the biggest features, a brief history of C# and .NET, and a little look at the “snippet” style of listings used in the rest of the book.
Chapter 2 – Core foundations: building on C#1
Although the rest of the book is written about C# 2 and 3, I wanted to make sure that all the readers had a good understanding of three aspects of C# 1: delegates, value/reference types, and the nature of C#’s type system. While all of them are important in C# 1, they’re often misunderstood – particularly delegates, which aren’t used very often in C# 1 beyond event handling. Delegates are friendlier in C# 2, and understanding C# 3 is practically impossible without a good handle on them.
Chapter 3 – Parameterized typing with generics
Generics are the biggest feature of C# 2, and the biggest change in the .NET 2.0 CLR as well. In this chapter I look at why they’re needed, how to use existing generic types/methods as well as how to write your own. Some more advanced topics are covered such as thinking about what the runtime does with generic types, and I examine the generic collection types provided by .NET 2.0. Finally, I cover some of the limitations of C# generics in C#, including the lack of covariance/contravariance (which is one of the most frequently asked questions in the C# newsgroup).
So, I hope that’s whetted your appetite a bit. Obviously I’d be overjoyed if all of you lovely people bought a copy of the book, but even if you don’t want to part with any cash right now, I’d still appreciate comments. Rather than talking about the book here in my blog, it’s best to use the author forum which has been set up for that very purpose. If you want to keep things private, you can email me directly of course.
Having worked this hard on the book, I reserve the right to plug it on this blog every so often – but I promise not to turn the blog into just a stream of adverts :)
5 thoughts on “Announcing “C# in Depth””
Congrats Jon. Just out of curiosity, how much of this book did you need to “research” as oppossed to just “brain dump”?
LOL. I knew most of the C# 2 stuff beforehand, although the book goes into enough detail that I had to consult the spec on quite a few things (lifted conversions, iterator block mechanics etc). My own C# 2 knowledge has definitely improved in the course of writing that part of the book.
As for C# 3 – to be honest, I didn’t know much in the way of details before I started. I’d been through the tutorials and written a couple of test classes, but that’s about it. I hadn’t immersed myself in it for long enough to appreciate how much it can change the world.
Extension methods and implicit local variable typing are good examples of this: I still think the way that extension methods become available is a bit laissez-faire, but otherwise I’m much more keen on both of these features than I was back in 2005. As for lambda expressions… I’m sold. Completely.
Of course, the fact that the C# spec changed quite a bit between the May 2006 release and the recent Unified C# 3.0 release didn’t help much – but Eric Lippert on the C# team has been a complete star. I can’t begin to thank him enough for his support. (He’s not alone, but he’s been overwhelmingly generous with his time.)
So, that’s the long answer to a short question. The short answer is: quite a bit.
Jon, did you notice that your name is misspelled on the cover of the sample chapter?
Yup, I certainly noticed that :) Hopefully it’ll be fixed for the next round of MEAP.
It sounds like I’m squarely in the center of your target audience. And I enjoy reading your newsgroup posts. I guess I better buy the book!