I’ve had a difficult time getting through what could be considered the first book in this series, so I decided to read the .NET Framework Standard Library Annotated Reference (Volume 1: Base Class Library and Extended Numerics Library) instead. It’s written by Brad Abrams with various other contributors.
This book is mostly a reference book that covers a subset of the .NET Framework Standard Library. Considering the easy availability and detail of the MSDN documentation, you might not find this very useful as a reference. It does provide interesting summaries of the core namespaces, and it is nice to see all of the method signatures supported by a class in just a page or two, but I can’t see myself using it much for reference purposes.
Unsurprisingly, the selling point of the book is the annotations. I wish there had been more of them, but since the annotations are really the only interesting reading, it makes this book very easy to read through. Some highlights:
- Don’t catch, throw, or even derive from
ApplicationException.
ArgumentNullException and ArgumentOutOfRangeException take the parameter name as its first constructor argument, but their base class, ArgumentException, takes the parameter name as the second constructor argument (after the message).
Array.Copy can be very useful.
- Prefer using
SyncRoot to the Synchronized method.
- Seal your custom attribute classes for better performance.
- Expressions within a conditional method are not evaluated when the condition is not met. (So calls to methods within a
Debug.Assert wouldn’t be called in Release mode.)
- Delegates are immutable.
- The static
Equals method of the Object class deals with null.
Stream.Null makes a great bit bucket.
- Streams work with bytes; Readers and Writers work with characters.
- A
ThreadAbortException is automatically rethrown if caught.
All in all, I really enjoyed the annotations, but considering how much of the book is uninformative reference material, I can’t say that you’ll find it worth the money.
Update: I should also mention that it comes with a CD that contains all of the samples from the book. More notable, however, is the 3,864-page PDF document that replicates the content of the print book, except that it includes documentation for each member of each class. Fascinating, to be sure, but certainly MSDN is more convenient.