Back to Basics: The Key to Mastering Software Development
Michael K. Campbell reviews the book C# How-To, by Ben Watson, using it to argue the importance of a strong grounding in software development basics
August 24, 2011
In a recent discussion with my oldest daughter about the importance of basics and piano practice, I found myself reaching for a beginner-to-Intermediate C# 4.0 book with Post-it Flags "flagging" a large number of pages. What I hoped to communicate to my daughter (who was bored with the basics of piano) was that even though I've been professionally developing for over a decade, I'm still constantly focusing on the basics—because I'm convinced that mastery of anything only comes from a solid understanding of the basics.
How I Suckered You in to a Book Review
Ironically, what made me reach for a C# 4.0 book when talking to my daughter was the fact that I had been anguishing over whether or not to do a book review for my next DevProConnections Update.
On the one hand, I think book reviews are cheap. They're fairly easy to write and just don't strike me as being as beneficial as articles where I outline examples of how to solve technical problems or work with technology directly. On the other hand, book reviews are probably more constructive than many of my editorials/rants.
But, in musing about whether or not to spout off about Windows Azure, do an article on how to leverage SQL Server Full Text Indexing within .NET applications, or tackle a book review, I couldn't help but think about how much I had enjoyed C# 4.0 How-To (Sams Publishing), by Ben Watson—simply because of how many pages and recipes I had flagged.
C# 4.0 How-To, by Ben Watson: A Fantastic Cookbook
Simply stated, C# 4.0 How-To, by Ben Watson is a fantastic book.
Above and beyond being a great cookbook that's chock-full of recipes for C# developers, I was impressed about how it made me think about my understanding of C# basics. Recipes in this book require very little documentation, as the code defined in them is very well written to the point where it clearly defines how to solve the problems outline, or listed, as part of each recipe. The author also does a great job of pointing out potential pitfalls and addressing best practices when and where needed—making recipes more valuable than the mere code used to solve a given problem.
In no particular order, here are some other things that I really enjoyed about this book:
I found it to be a great way to "review" C#. If you think you know your stuff, then skimming through all of the recipes in this book will only take you an hour or so. And, if you do this, I can guarantee that you'll find or spot things that challenge some of your existing assumptions or make you question ways that you're currently doing things. (And while I think you could get a similar experience "cruising" C# documentation, what I think makes this book so valuable is the way it has condensed so many different aspects of coding with C# 4.0 into a single resource and the way in which the code samples are so logically defined and laid out.)
This book is vast. It covers C# language basics, numerous intermediate and even advanced concerns (such as threading), and then lightly touches upon virtually all aspects of how to use C# within the .NET Framework—meaning that there are recipes for Entity Framework (EF), working with Silverlight, ASP.NET, Windows Communication Foundation (WCF), XML, and so on. In-depth coverage of any particular topic (other than C# language basics) is beyond the scope of this book. However, but one huge benefit of this book is that many of the recipes are "linked" in ways that make learning about certain facets of the .NET insanely intuitive. For example, coverage of threading, asynchronous operations, and parallel programming was one of the best overviews of the complexity and pitfalls of "async" programming that I've seen. And it was done in a tiny amount of space with very little documentation thanks to a set of very well-crafted examples that "tell the story" themselves.
It offers a great overview of WCF. In a similar fashion, the clear and concise nature of the recipes/samples in this book provided one of the best overviews of WCF I've ever seen. So much so that I actually got off of my butt and started looking at WCF as a viable, potential, solution to some upcoming projects. And, again, the nature of this book isn't such that it can be a definitive guide to all things WCF. But the interrelated examples that showcase how to use WCF to transmit messages in sample apps made me finally say: "Duh—why wouldn't I use WCF?" instead of wondering about all the horror stories I've heard about configuration. Even better, the examples in C# 4.0 How-To that deal with WCF make it quite clear just how huge of a role configuration can be, by directly addressing configuration in successive recipes. So, in this regard, I found this book to be invaluable due to its ability to provide me with clear examples of how to leverage aspects of the .NET Framework that I haven't really played with yet.
It provides practical guidance. I also found that C# 4.0 How-To does a great job of dealing with some of the "perennial debates" that have surfaced in C# over the years—such as whether or not to use StringBuilder or string concatenation in certain cases, or when/how to throw exceptions. As such, what makes this book a great resource is that it provides usage guidelines where needed (such as on the last page of the chapter on exceptions) or defers to validation and testing (rather than rhetoric) when it comes to things like how to best judge when you should use a StringBuilder or not—by means of providing a graph that plots execution times for various approaches over multiple iterations.
Something for Everyone
If you're a budding C# developer, you'll find plenty to love in this book. (However, even though it says that it's targeted at beginner to Intermediate readers, if you don't have past programming experience, this book is not for you—it is for developers who are beginner or intermediate in their use of C# as a programming language of choice.)
If you're a seasoned veteran in the war on code with C# as a primary weapon of choice, you'll still find plenty of great, useable recipes in this book. I also think that if you spend some time skimming through all the available recipes in this book you will find a number different recipes, approaches, and paradigms that you'll "flag" for additional consideration or even use in some of your projects. Quite likely, you might even think about "changing your ways" in regard to some of the information presented in this book.
That, and this book is dirt cheap. I purchased my copy for $25—an insanely good deal given the amount of information this book covers and also because I bought it to answer some questions about "cool new .NET 4.0 ways" to address some problems I was contemplating (which this book perfectly addressed). Consequently, I can't recommend this book enough, not only because of the excellent reference it is for anyone doing C# 4.0 development (or getting ready to do so), but because of the great insights it engenders and the way in which it caused me to think more about the "basics" and how I interact with C# on a regular basis.
Michael K. Campbell ([email protected]) is a contributing editor for SQL Server Magazine and a consultant with years of SQL Server DBA and developer experience. He enjoys consulting, development, and creating free videos for www.sqlservervideos.com.
Read more about:
MicrosoftAbout the Author
You May Also Like