Book Review: Writing Solid Code
![]() | Writing Solid Code: Microsoft's Techniques for Developing Bug-Free C Programs (Microsoft Programming Series) by Steve Maguire Read more about this book... |
I finally got around to reading Steve Maguire's Writing Solid Code: Microsoft's Techniques for Developing Bug-Free C Programs, thanks primarily to a coworker who lent it to me to read over the weekend.
Written in a personal, easy flowing style, it contains many suggestions for improving your coding process, when developing in C. It is a fast read, and I liked the book even though I felt that much of it was somewhat outdated.
Steve Maguire wrote this book in a different time, a time before OOAD, C++, Java, RUN, XP, Agile, XP, and TDD. The book grew out of his experiences at Microsoft and contains practical advice and lessons learned about software construction and projects.
He even starts by asking two questions about bugs found in code: 1) How could I have automatically detected this bug? and 2) How could I have prevented this bug? Therein, he starts to build the process and techniques for eliminating bugs.
The generalized advice is certainly still valid:
- enable compiler warnings and investigate each one;
- use assertions;
- fix bugs now (don't wait until "feature complete" to go back and fix them);
- don't quietly ignore error conditions;
- don't write multi-purpose functions, focus on very specific functions that can be checked;
- write code for the average programmer (make it readable);
- don't wait until a bug to step through the code;
- developers are responsible for finding bugs;
- porting code is new development and should be tested as such;
- carefully bound check arguments
Conclusion
The book is an interesting snapshot in time, and contains a lot of good advice. However, the book is just simply too dated to be recommended. What was once a ground-breaking collection of cutting edge advice now should be common sense for most experienced developers.
It was recommended as a must read "classic." It isn't.
