Introduction
I've recently passed the Microsoft 70-483 "Programming in C#" certification which is one of the entry points into the .NET and WinRT developers certification cycles.
To be well prepared, I read the two books entirely dedicated to this certification: MCSD Certification Toolkit (Exam 70-483): Programming in C# and Exam Ref 70-483: Programming in C#.
I strongly recommend you read both of them if you intend to pass the certification.
Indeed, both have been my main materials to prepare for the certification and they have perfectly done the job.
This article is a complete review of MCSD Certification Toolkit (Exam 70-483): Programming in C#.
This is the first book you should read because I think this is the one that will best prepare you to get the certification, but paradoxically the worst from a technical point of view, and you will quickly understand why.
It’s unfortunately the biggest flaw of this book: it contains a lot of technical errors, ranging from the basic misuse of words that only experts will spot and innocuous for neophyte, to bad practices, including wrong affirmations, and this is more annoying. And sometimes, inside a section, you have both some really good content along with really bad content.
This article is not a complete errata, because I’ve not taken note of every single error, but I’ll try to illustrate the main issues in order to establish a typology without being exhaustive.
I’ve chosen to present the worst content first, the bad practices, to go to the best, the good practices, because this book is equally full of really good technical content that is perfect for the certification and in your daily job as a developer.
The Bad Parts
Some Bad Practices
Teaching bad practices, especially when a big part of your audience is made of non experienced developers, is probably the worst thing a technical book can do.
However, let’s be honest, fortunately there are few bad practices in this book and as it does not pretend to be a technical reference, this is not unacceptable.
As an example, naming conventions are often not respected, so we have methods named displayName
, concatenateName
or square
, which would imply that the author of this code is a recent Java defector. I won’t judge it as I’ve myself followed the same path and it took me some time before I completely accepted and applied these conventions.
Less innocuous is the modification of the state of a value type instance which demonstrates an unfamiliarity with the subtleties of this category of types. But in the author(s) defense, a minority of C#/.NET/WinRT developers are aware of this “issue”.
Still concerning value types, the book states it’s better to use arrays of references than arrays of values because values would be copied. It’s completely wrong because arrays are themselves reference types so are manipulated through references, hence in both cases, there is no copy involved. Then this is not a good reason to use the “by reference” semantics, though by default, this is the one we should choose.
As for the design of classes, the book mixes business data with purely technical treatments, like accessing a database, instead of decoupling them.
Decoupling is yet the ABC, and would have cost nothing there, so there is no reason not to demonstrate it to beginners.
But in the book’s defense, the certification’s questions are far from being exemplary in this regard.
Finally, when demonstrating ADO.NET, most of the examples don’t leverage the using
block to control the range of the connections and commands objects, though this best practice is discussed later in a dedicated sidebar.
Some Errors
A little less serious are purely technical errors like the affirmation that the current element in a foreach
loop must have the correct type, which is wrong, and it’s kind of “dangerous” and the source of a lot of bugs: foreach
implicitly converts the value if the type is not correct: e.g. double
to int
.
Some illustrations are wrong: e.g., for extension methods, the book speaks of extending the Math
class which is useless because it can’t be instantiated because it is a static class
, and it’s really no luck for the authors because this class is more an exception than the rule, so a really bad draw.
“partial
” classes are described as generating many files inside the same assembly whereas they are all aggregated by the C# compiler in a single class whose byte-code is integrated as a whole to the assembly.
We also “learn” that we can set an instance of a value type to null
which is completely wrong: null
makes sense only for a reference to an instance of a reference type (and nullable types).
The book states that instances of value types are always stored on the stack: wrong, they can be inlined inside instances of reference types in the heap, but this is a popular belief in the community so we can’t blame the authors.
More anecdotal, we are taught that the int
type can store values up to 4 294 967 286 whereas the limit is half of that.
More annoying, but again a popular belief, the book states there are 2 ways to pass parameters: by copy for value types and by reference for reference types, sounds good but wrong, all is done by copy, including copy of reference for reference types, and if you want to pass by reference, you must use dedicated ref
and out
markers.
But more original is the fact that “abstract
” methods would be referred to with the synonym “virtual
” methods whereas they are two concepts related but distinct: an abstract
method can be considered as virtual
, but not in the other direction. So maybe an issue with the understanding of fundamental concepts of object oriented programming concepts which would confirm my hypothesis of a strong Java bias: Java developers are those who use the more virtual methods but also those who less understand what they are and how they differ from abstract
methods (relatively to C++ and C# developers). Paradoxal? Now when we know that by default all the instance methods are virtual in Java, so a Java developer will never have to write the word “virtual
” whereas C++ and C# developers must be explicit.
Some Approximations
While I agree that some simplifications are harmless for the novice and can avoid throwing too much information at once or making them doubt, I consider that ideally, one should not prepare a certification only for the sticker but above all to confirm a real expertise, and to learn new things, and this requires some technical accuracy.
Here is an example of this kind of harmless error that demonstrates a lack of full understanding of the language: the last part of the for
loop is described as carrying on an instruction expressing counting (++
, *=
, -=
…) which is wrong, it can even be missing.
Of course, a lot of talented developers can have a brilliant professional career by believing that without any consequence on the quality of their work and their productivity.
Another example of the same type is the description of the while
and do-while
loops as two completely distinct entities whereas they are the two faces of the same coin.
Similarly, when presenting the extension methods for the first time, it is said that their purpose is to extend classes without recompiling them, which is only a relatively anecdotal point.
Fortunately, in this case, the correct definition is given in another section, hence the importance of reading the book entirely.
Comparing the for
loop and the foreach
loop, the book states the latter is there when we don’t know the number of elements whereas this is more the lack of an indexer that will decide of the use of foreach
, and indeed some collections expose their length but don’t provide an indexer so are best iterated with foreach
.
It’s a pity that developers with this amount of experience use such approximations as confusing the IDE and the platform: it is said that Visual Studio calls the constructors whereas of course, this is the role of the <string>CLR, Visual Studio does not even compile the code.
Unfortunately, developers who are not curious and have never developed outside Visual Studio don’t understand that when we develop this kind of application, we have 3 actors:
- .NET or WinRT which is the underlying platform that provides the types library and the runtime environment (for .NET)
- C# that is the programming language using a compiler that generates some binary code, like byte-code running on the .NET platform
- Visual Studio which is a productivity tool (IMHO the best) which interfaces with C# and .NET/WinRT using tools like MSBuild.
According to the book, the “volatile
” marker is there to indicate that the data could be modified by other components that our code, it’s only partially true, because it shines outside of this context (see another of my articles: Synchronization, memory visibility and leaky abstractions).
There again, the authors are forgiven because it’s the kind of subtleties you understand by practicing a little parallel programming and the majority of .NET and WinRT developers can develop completely ignoring it, and that’s a good thing.
Similarly, seems like the authors are not aware that &
is also a valid boolean operator, the difference with &&
being that it does not bypass. Unfortunately, one of the test questions is dedicated to this issue so the test is wrong, which is ironic because at the start of the book, there is a long introduction to how tests are designed for the certifications, and one of the prerequisites is that they must be non ambiguous.
Some topics seem not well understood like ORMs which are described as graphical tools whereas this is not at all their primary use case, as is demonstrated by Entity Framework which took a U-turn with the “Code First” workflow.
As for NHibernate, it is said to be an ORM dedicated to other databases and languages whereas its first use-case is the interaction with SQL Server from C#.
Some Word Misuses
Usually, words misuses are not serious, except once again for novices who need to remember rigorous definitions, in order to have points of reference helping them in their learning and the consolidation of their knowledge.
As an example, System.Int32
(alias int
in C#) is referred to as a class instead of simply a type (to avoid speaking about value types), probably a reminiscence of Java and its Integer type which indeed is a reference type.
Concerning C# structs, some fields are defined but are referred to as “properties” which will confuse beginners because later in the book, the properties themselves are of course referred to with this same term.
Often, the book uses the term “class file” instead of just “class”, probably another reminiscence of Java which indeed only allows a single public
class per source file, but even in Java, this is not an accurate term.
Similarly, the book speaks of interface instances instead of interface references, but an interface cannot be instantiated, so again confusing for beginners.
Another not completely mastered topics is the BackgroundWorker
: the Invoke
method is used in the events handlers ProgressChanged
and WorkerCompleted
whereas the purpose of the BackgroundWorker
is precisely to avoid that by automatically capturing the context, and invoking the handlers on the UI thread itself.
Some Minor Issues
As you would expect, the book suffers from a blatant lack of proofreading: there are a lot of typos and grammatical errors, but fortunately, they never affect the understanding, the context always helping to grasp the content.
Towards the end of the book, there is a big bunch of code to demonstrate validation and Windows Forms.
First, I don’t understand the purpose of dumping such a quantity of code, secondly, it concentrates a lot of bad practices: playing with flying values instead of consolidating them in dedicated types, business code directly in the UI event handlers instead of being isolated in dedicated components, background color of controls used to store business data, the validation state of the form, which is a strange practice.
There again, the danger is for novices that might learn a lot of bad practices and apply them in their professional context and even teach them to their colleagues.
Some technical terms are defined in the glossaries of some chapters but are never addressed which may mean that some sections have been simply “forgotten”.
Some topics are repeated: the section on delegates, anonymous functions and lambdas appears 2 times, with two different texts, so probably 2 authors have worked on it without coordination.
Too much time is dedicated to obsolete components like ArrayList
now replaced by their equivalent generics classes.
The Good Parts
Listing only errors would be really unfair because this book is full of very good content, some sections are of high quality, worthy of the best technical reference books.
Some Good Introductions
First off, the book offers a panorama of the tools used for developing with C# in .NET or WinRT, and many sections are small introductions that allow the reader to quickly understand the ins and outs of a given tool.
The introduction to parallel programming is really correct, including a small rundown on the thread-pool and its limitations like the inability to make a join
, and another on the asynchronous methods in C# 5.0.
The part on monitors is perfect to revise but a little too short for a beginner discovering the topics who will probably not understand some concepts like the “ready-queue“.
The book also has a good introduction to Entity Framework and illustrates its use with the “Database First” workflow which is one of the 3 workflows supported by EF.
LINQ is also well covered and the two syntaxes for building queries are presented: via the mini-language integrated to C# or directly via chaining of methods provided by the Enumerable
static class.
The introduction to security is really broad while being quite compact and addresses various topics like hashing, symmetric and asymmetric cryptography, and, amongst other topics, certificates.
It’s perfect for developers who like me “know” these topics but are not completely aware of how to implement them using .NET/WinRT.
And by the way, I had one question on this section during the certification exam.
Some Good Illustrations
As an example, the use of the do-while
loop is illustrated with a relevant and recurrent use-case: the reading of input from the console.
Similarly, the book provides a non-trivial example for the use of an enumerator which helps the reader to understand how the foreach
loop works under the hood.
There are also good examples on object oriented programming, particularly on the use of abstract classes and virtual methods, as well as the notions of contract and interface (e.g., with explicit implementations).
To illustrate the importance of reflection, the book uses the context of object relational mapping which, besides being a relevant use-case, is a great technical demonstration for novices because in 20 lines of code, we have a mini <string>ORM, whereas at first sight, we would expect a far heavier implementation.
Some Topics Really Well Covered
Some topics benefit from a better attention with some really comprehensive technical elements.
This is the case for string
s, their immutability and storage management by the CLR ((interning) being well addressed.
The introduction to the inner workings of garbage-collection is short and of high quality, and especially insists on the non-determinism, illustrating it with the use of files.
This example helps the reader to get a natural understanding of the goal of finalizers/destructors and the disposable pattern.
The explanations are balanced: enough technical depth to correctly understand the inner workings and acquire some knowledge going beyond the certification, without bogging down the novice with too many subtleties, while exposing the rationales and use-cases.
It’s one of the best descriptions of this topic I’ve ever read.
Another example where the content is better and richer than expected for the certification is CodeDOM which benefits from a complete and rich demonstration using C# and VB.NET that goes beyond the canonical example, copy pasted everywhere on the web and books, consisting in compiling a “Hello world
” program in C#.
Some Contextualization and Good Practices
To finish, you have to know that the book gives a lot of information that helps the reader to put things in perspective, along with some good practices.
Even if this is not really useful for the certification which primarily evaluates your capacity to use the tools, not to talk about them, this will help every developer to better understand some tools he uses without a real understanding of them.
For example, the rationales of enumerated types are really well explained, insisting on the enhancement of readability hence maintainability of code.
Similarly for generic types and methods the book insists on all their benefits like code reusability, type safety and performances.
The introduction of the encapsulation concept is really good, invoking validation and the use of transformations to avoid SQL injections as relevant use-cases, the latter being less realistic, but interesting.
The book puts emphasis on good practices like the systematic use of curly braces even when there is only one instruction, typically for the if
block.
Often there is good advice like the importance of not exposing sensitive information through exceptions, and making them serializable if they must cross the boundaries of an app-domain.
Finally, the book refers to good additional resources like pinvoke.net which is almost essential when working with native interop via P/Invoke (DllImport
).
Global Assessment
The principal interest of this book is that it presents a large spectrum of topics, and IMHO, it is complete with regards to the certification official program.
During the certification, I did not encounter a question whose topic was not discussed in this book.
Depending on the reader's current skills in C#/.NET/WinRT, this book will profit her/him more or less:
- If you are really strong, senior with at least 5 years of experience, then you’ll be able to sort the wheat from the chaff (the nugget from the errors), and this book will be one of your best allies to pass the certification
- If you have an intermediate level, with strong basis this book may help you to reach the next level, because it lists the important technical topics you have to work on
- But if you are a beginner, ignoring the fact it may be too soon to pass the certification, this book might be dangerous if you naively learn some errors and bad practices, so you must double your vigilance and in case of doubt, do not hesitate to ask experienced developers.
As for me, I could divide the content of this book as follows:
- 75% was made of stuff I knew the book helped me to revise,
- 15% was about topics I had forgotten and I was happy to have taken the time to read this book entirely because missing 15% of the program is a lot, it represents half the error margin you have for this exam (you must have at least 700/1000),
- 10% were topics I didn’t know, I may have heard of, but that I had never used like WCF Data Service or the possibility to inline options inside regular expressions, or some best practices I had missed like using labels with
#endregion
directives.
So I’ve really learnt a lot by reading this book, some things less important than others, but every piece of knowledge is good to take when you aim at expertise.
Conclusion
As you’ve seen, the content of “MCSD Certification Toolkit (Exam 70-483): Programming in C#” is very uneven.
What I don’t understand is why the ebook version has still so many errors despite the many strong reactions, IMHO often a little disproportioned, of offended and disappointed readers.
So Should You Read This Book?
If you want to pass the 70-483 certification, the answer is a strong “yes” because this book correctly summarizes all the technical points you’ll need to know to success, and it will help you find where you have some weaknesses you should work on.
This is also a choice by default because there is not really any alternative.
However, if you need a technical book to develop your current skills and gain new ones, then I don’t recommend this book as you might learn some bad practices, and reading a book being suspicious is really not good for memorization because we tend to not believe anything.
Above all, don’t do as other readers who have stopped to read it after a few pages or chapters upset by the accumulation of errors, and for two reasons:
- The quality of this book really enhances chapter after chapter, and while I’ve found a bunch of errors in the first part, I’ve found almost nothing towards the end, as if the first part was written by a novice developer, the middle by a more experimented one, and the final part by an expert.
- Even in the parts full of errors, there is some important information and even some nuggets.
So even if you are considered an expert, this book will teach you something and it would be a pity to not read it to pass the certification.
What is sure is that this book is the result of a huge amount of work that deserves a lot of respect, and better to have imperfect resources than no resource at all.
My Final Rating
Rating this book is quite difficult because on the one side, I consider the accumulation of technical errors and approximations really harmful for the novice readers who probably represent an important part of this book’s audience, but on the other side, this book perfectly does the job of preparing the reader for the certification.
If it was a book with the pretention of being a technical reference, I would note it quite severely: 5/10.
But for a reader only willing to obtain the certification, it is well worth 9/10.
So I’ve finally rated it 8/10, 4 out of 5 stars on Amazon, because I’ve considered that passing the certification is really the point of this book which is not a technical reference, and so I’ve overweighed this aspect.