Programmer's Book Review

C/C++ Users Journal May, 2005

By Peter N. Roth

Peter Roth is the president of Engineering Objects International, producers of commercial and custom C# components. Peter can be contacted at http://www.engineeringobjects .com/ and pete.roth@verizon.net.

.NET Compact Framework Programming with C#
Paul Yao and David Durant
Addison-Wesley Professional, 2004
1424 pp., $60.00
ISBN 0321174038

.NET Framework Standard Library Annotated Reference, Volume 1: Base Class Library and Extended Numerics Library
Brad Abrams
Addison-Wesley Professional, 2004
560 pp., $65.00
ISBN 0321154894

With .NET Compact Framework Programming with C#, Paul Yao and David Durant try to cover the PocketPC waterfront by starting with an answer to the basic "What is .NET?" question, and moving from there to programming to the framework, programming around the framework (drilling through .NET into the Win32 API), dealing with controls, graphics, mobile data, ADO.NET and, as the saying goes, much more. I assume that the similarly titled volume for VB.NET (not reviewed here) contains the same text, but different code. For the most part, the writing is easy going and easy to understand, with lots of code. At 1400 pages, there is a lot of stuff to read.

Sorry to say, the book is physically hard to read. Yao and Durant recommend and use Hungarian notation, a carryover from VB6 and earlier, which contravenes "recommended C# style coding style." Compounding the readability issue is a font problem. Explanatory text is in an "old style" font (like what you're reading now), and is quite legible. On the other hand, the code font is Courier, but it's "broken": Some letters are consistently darker than others, within the same token. You can manage to read this when looking at a class listing, but it's nearly impossible to easily read mixed text and code; the eye is continually tricked.

Sidebars are set off by printing with a dark gray background—in those text blocks, the inline code becomes invisible.

So this text is one with which you must struggle, literally. Since this is the first volume I've reviewed for the Compact .NET Framework, the readability problems require that I reserve recommending this book until I've seen others.

.NET Framework Standard Library Annotated Reference, Volume 1: Base Class Library and Extended Numerics Library, by Brad Abrams, a handsome hardback volume with a cloth ribbon bookmark, is one of the Microsoft Development Series (the "checkerboard covers"). You need the bookmark because this is not a book you would try to sit down and read straight through. It's more like a medicine—I take a dose a day.

The book is organized into two parts, plus the usual front matter. Part 1 is an overview of the .NET namespaces delineated in the title. These are synopses of the System namespace, from which everything in .NET descends, and these immediate children of System: Collections, Diagnostics, Globalization, IO, Security, Text, and Threading.

Part 2 is an alphabetic list of the classes in those namespaces. The text in this section describes the classes, while the annotations offer some rationale for library design choices. Each class section includes sample code, where "sample" means "soupcon." Only small portions of each class are demonstrated. I was particularly interested in the Array type because I wanted to compare the examples with my own Matrix and Vector classes. I was looking for a way to use the jagged array to store large symmetric matrices. Jeff Richter noted that he has used the Array class for multidimensional arrays, indexed from a nonzero base in VB.NET. I've played around with this code, but I haven't been able to get this to work in C# yet.

Regarding the accompanying CD: I copied everything to my hard drive first. The complete book is there as a 38-MB Adobe PDF document in which the "text copy" button has been disabled. The HTML files are mostly useless—if you click a link in one of these files, it loads the Adobe Reader into a browser window. Not wishing to incorporate this additional layer of indirection, I tossed the HTML files.

All the sample code is there, too, as both a self-extracting archive and a zip archive. Using Winzip, it took less than a minute to extract 1.82 MB of code and makefiles. Some file names were "too long," so Winzip skipped over their extraction. Other filenames contain what I consider unusual characters: parentheses, commas, and braces. I wound up erasing the extracted files, and will return to the zip archive to extract what I need, if and when I need it. Building all of the samples can take several hours, according to the instructions.

What you're getting with this book is a description of the classes and the annotations in one easy-to-access place, but you'll need to look to a Microsoft IDE or MSDN to beef up your collection of example code.