Dr. Dobb's Journal, February 2006

Inside C# and .NET

By Peter N. Roth

Peter 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.

Core C# and .NET
Stephen C. Perry
Prentice Hall PTR, 2005 1008 pp., $49.99
ISBN 0131472275

The target audience for Stephen Perry's Core C# and .NET is the "experienced programmer." I fit that profile, and based on this book would guess that at least three years of professional programming is a reasonable minimum to qualify as such.

Part 1 of Core C# and .NET includes an introduction to .NET and C#, C# fundamentals, class design, and working with objects. If you're new to C#, you'll want another text to cover the language in more detail. (I recommend Peter Sestoft and Henrik Hansen's C# Precisely.)

In part 2, "Using .NET," Perry includes chapters on text manipulation and file I/O, Windows forms programming and controls, graphics design, fonts/text/printing, XML, ADO.NET, and data binding. The file I/O chapter, in particular, goes a long way to answering questions that show up in newsgroups. And while the book covers Version 2.0 of C# and .NET, the buzz on Version 3.0 has already started, so you can expect that some of the ADO.NET stuff is "transitional" (but then, what isn't?). The so-called "advanced" section (part 3) addresses the topics of threads, distributed apps, and refinement/security/deployment. While I claim to be an experienced programmer, I must confess that I have never written a threaded or distributed app, so this material was new to me.

Part 4 deals with programming for the Internet, and includes chapters on ASP.NET web forms and controls, the ASP.NET application environment, and XML web services. Finally, two appendices display the differences between .NET 1.0 and 2.0, as well as the Events and DataGridView control.

Thus, the text is broadly comprehensive. At the same time, you can do only so much in 1000 pages, so the depth is limited accordingly. Topics average about 56 pages each, which is still a solid chunk for each area addressed. Code examples are downloadable rather than on a CD, which seems to be the current trend in computer books. A bonus download is the Quick Reference—print it, fold it, and stick it into a niche on your desktop (if you have any room left).

Admittedly, .NET and C# are moving targets, and I admire authors who take a shot at them. To that end, Perry does a splendid job; though I have a couple of mild cavils: The presentation of conditional compilation should use the new idiom, which is the [Conditional(symbol)] attribute, rather than the older (and well-known) #if (symbol)/#endif construct. And I found the idea of using a command-line compiler "to get started" a little unusual, given the number of free IDEs out there.

Still, the text is clear of typos and misspellings. But somehow, the military outline for oral presentations ("tell them what you're going to tell them, tell them, tell them what you told them") has been carried over into texts. Hence, for each chapter, there is a beginning of chapter summary, a chapter, and an end of chapter summary. This insults our intelligence and wastes paper, because we can easily read the table of contents and scan the chapter to determine what's coming. We can read the chapter to determine what it is; and we can review all the material to determine what it was. It also makes for a lighter book, or alternatively, the freed-up pages provide more space to the author. In the blank, dark gray "separator" pages: They're not quite dark enough to be easily visible. In this case, a black bleed strip down the edge of the first printed (nonblank!) page of a chapter would be preferred, and save yet another page.

My rant notwithstanding (hey, I'm entitled, I'm an experienced programmer), in general, Core C# and .NET is an excellent production that meets its stated aim—to provide a foundation for programmers moving to .NET.

DDJ