Author: Andrew Stellman and Jennifer Greene
Publisher: O'Reilly, 2010
Aimed at: Novice C# developers
Pros: A highly interactive approach for the complete beginner
Cons: The format results in a hefty tome
Reviewed by: Mike James
This is the second edition of Head First C#. There are 100 additional pages but not much has changed.
O’Reilly’s Head First series has a distinctive format – a cross between a notebook and a joke book – that you will love or hate. The mix of conversational style, lots of graphics, copious annotations and quiz elements. It all looks very exciting in a hyperactive sort of way.The one clear point is that you should only buy it if you are prepared to work through the book rather than read it – as is pointed out in the pre-amble the activities are not optional. It is also arguable that learning to program is about logic and this isn't suitable for this sort of frenetic approach.
As long as you like the book’s style, beginners will find it motivational. As author’s Andrew Stellman and Jennifer Greene point out the advent of C# 4.0 plus its availability in the free Visual Studio 2008 Express Edition make this a really good time to get to grips with C# and this book shows how the Visual Studio IDE makes it quick and easy to get started.The only problem is that the first example uses a database that the IDE autogenerates code for - surely a simpler example would be better and database can wait until the reader has mastered some C#.
The activities are all similar in that they tend to mix the simple with the very complex and are only suitable if you are prepared to put a lot of work in and actually do them rather than just read. The three hands-on labs in the book are all games – and if you are pleased with your efforts you can show them off on the book’s own website, from where you can also download the games’ executables if you need extra help and support.
The book covers many advanced C# features such as LINQ for objects. In this case it is used in unconventional ways in the final lab – Space Invaders – to make collision detection easier. It also covers some of the new features introduced in C# 4 - such as named parameters but not dynamic types. It is arguable that both of these could be introduced early in a beginners book to make creating a first program easier.
On the whole, however, this isn’t an advanced treatment and even when it tackles sophisticated ideas – encapsulation and polymorphism for example – it treats them in its informal, even glib, manner.This is something of a problem because do you really want to be bogged down with a discussion of database objects when you are just struggling to see what C# is all about.
In fact this is a problem throughout the book where simple things are introduced alongside much more difficult and often abstract ideas. For example, it gets into interfaces. inheritance and the subtleties of type before the reader really has had time to get to become comfortable with variables and the flow of control. On page 59 we have a discussion of the fact that two classes can be in the same namespace - why even raise the idea of namespace at this early stage? Yet on next page we are discussing variables and two pages further on loops are introduced with out very much preparation. These complex ideas are introduced as if they were obvious and all you needed was telling that they existed. If you are a complete beginner then you are likely to not follow. If you are not a complete beginner then why are you reading a book like this one?
If you get to the end of the book, which given it is more than 800 pages is quite a challenge, you are likely to want at least one more book about C# but at that point you’ll be ready for something with a more staid and stolid, and abbreviated, approach.
Overall this is an over-complex approach to learning a language and it really doesn't have a clear idea of what order ideas should be introduced or what a beginner has difficulty with. In this case the Head First format makes the situation worse by making even the simple look complex and chaotic. Of course if you love the hyperactive approach to learning then you might like it. But it's still not as good as it could be.