Å·±¦ÓéÀÖ

Jump to ratings and reviews
Rate this book

Writing Solid Code

Rate this book

Fatbrain Review Explains Microsoft's techniques for developing bug free C programs and provides practical approaches to the prevention and automatic detection of errors. Focus is on an in-depth analysis and exposition of not-so-obvious coding errors in the sample code provided. The theme is to answer the questions 'How couild I have automatically detected this bug' and 'How could I have prevented this bug'? Chapters include programmer attitudes, techniques and debugging methodology. A particularly revealing chapter is "Treacheries of the Trade", should be required reading for all C maniacs. The author has been a professional programmer for seventeen years and draws heavily (and candidly) on actual coding problems and practices based on years of experience at Microsoft.

256 pages, Paperback

First published January 1, 1993

18 people are currently reading
941 people want to read

About the author

Steve Maguire

20Ìýbooks12Ìýfollowers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
135 (39%)
4 stars
133 (39%)
3 stars
56 (16%)
2 stars
11 (3%)
1 star
4 (1%)
Displaying 1 - 23 of 23 reviews
Profile Image for Danien.
44 reviews
March 11, 2010
It presents fundamental techniques for writing robust code, such as assertions, that should be part of every good programmer's toolbox. Although the book uses C, it is applicable to almost any programming language that uses procedural programming.

This book should be read as soon as possible in one's programming career as it provides a starting point to develop good programming habits.

This is a must-read for programmers.
Profile Image for Alex.
38 reviews2 followers
December 24, 2022
Tl;dr: this is a great book.

I discovered this book accidentally at about the same time I was reading "The Practice of Programming" by Kernighan and Pike. And while they're both about professional programming in C (whatever Kernighan and Pike say in their introduction, TPoP is mostly about C, with cameos from C++, Java, Perl and AWK) they are very different books. But I digress.

"Writing Solid Code" is about how to write production quality, reliable and maintainable (C) code. Don't be fooled by the emphasis on C. Most of the advice applies to programming in general. And even the sections that are C specific are worth reading, even if only for the appreciation you'll get for modern languages where you don't have to deal with C's quirks and dark corners.

The book is approachable. Maguire shares his (hard earned) experience without being patronising. It feels like an experienced engineer advising a fellow engineers on the tools he's using. At times it's almost like you're chatting with one of your more seasoned workmates.

This is definitely worth reading, no matter what language you use. I'll mentally tag this as an "underapeciated book worth re-reading every couple of years".
Profile Image for Rwik.
54 reviews4 followers
February 11, 2015
I referred to this book as a resource for a project i am handling currently. Basically I was looking for some developers guidelines and some coding standard skeleton. I have to take most of the advises hypothetically as most coding examples are a bit dated. Some of the techniques described (like extensive use of assert ) are actually replaced with some modern day techniques. But this book bears all the traits of a classic.
17 reviews
February 28, 2022
When I was changing careers into software development for pay, about 30 years ago(!), I read this book and started doing most of what the author said. It is one of the most influential professional books I have ever read, in part because it was also intensely practical. The author illustrated many of the principles by building up an implementation, in actual code, of a wrapper around the C language's standard library memory management functions. It saved many a night and weekend, along with a lot of stress, over the next 10 years.

I'm glad to see there's a second edition, because most applications developers no longer have to avoid shooting themselves in the foot with malloc(), realloc() and free(), and the example would be irrelevant. But the principles still stand. "Write Candy-Machine Interfaces" still applies, even though system interface technology has come a long way.

This book's proactive approach to quality through defect prevention by intentionally using all your developer tools is still valid, and can still change your professional life if you are not already applying it daily.
Profile Image for Bugzmanov.
230 reviews89 followers
September 21, 2021
I'm a bit thorn on this one. You have to be senior enough to see that 95% of this book is applicable to any language. But this probably means that you already know and agree with most of the book.
And I'm not sure that examples in Ansi C circa 93 would convince javascript newbie of anything.

I guess it's a great book for developers who have 3-4 years of experience, who have read classics on coding and design and who can easily decouple concepts from optics.

My main takeaway:
- asserts are great, i should be using more of those
- it's possible to resolve contradictions between fail-fast vs "make it robust" by using different release modes (debug, prod, etc).
- "zero bugs before QA" is a wonderful concept.
2 reviews1 follower
July 28, 2019
It's an old book but still relevant. Excellent analysis and advice in how to improve the development process.

It's interesting to note that agile processes like Scrum implement quite a bit of this advice in one way or another.
Profile Image for Jeff Keehr.
805 reviews4 followers
August 4, 2020
Lots of fairly advanced advice on how to keep bugs out of your software. It's a 260 page book, but it took me quite a while to read. Because the advice is on C and not C++, I'm not sure how much it is going to help me. But it did give me an appreciation for professional programming.
Profile Image for Rajasegar.
42 reviews
March 14, 2023
One of the best tech books you will ever read. Easy and enjoyable read with mind-bending insights for writing bug-free code. Aligns perfectly with reality since it is not loaded with platitudes but concrete set of guidelines and best practices.
98 reviews11 followers
March 6, 2024
A series of anecdotes about writing in ANSI C.
His prose is solid, so I believe him when he says his code is too.
But most of his anecdotes are about making mistakes with pointers, and those dissolve away if you just use a higher-level language.
Profile Image for Alex.
44 reviews3 followers
July 24, 2017
Excellent book. Don't let the book's age or the C-centric examples stop you from reading it - it aged extremely well.
Profile Image for Srivardhan.
106 reviews
July 7, 2014
A must read book for all the programmers as well as Managers. All project managers should follow the steps given in this book if they don't want a delayed release with buggy product. Programmers should adopt the suggestions made in the book to become a better programmer. This is not a one time read book, you need to keep reading this regularly so that you won't forget the tips.
Profile Image for lehaleha.
59 reviews2 followers
April 2, 2015
Some parts of it are not actual anymore - it was really shocking to see notes, like "don't reference deleted memory". At this moment I realized that was whole different world back then when the book was written. However (surprisingly) a lot of points, techniques and principles are still actual. Like "don't be a slacker and do a decent job, buddy". :)
15 reviews
November 10, 2015
This is a great, just amazingly great book about techniques to create a more solid code. A lot of small chunks of programming pearls which also will help you to deliver more succinct strategies on your team.
It has a lot of C code, but don't be intimidate for that, all the completely understandable and easy to digest.
Recommended to young and seasoned programmers.
Profile Image for Dave.
126 reviews8 followers
September 6, 2021
I really like this book. As a diehard c coder, there is a lot in here that is immediately practical. The philosophy is applicable to programming in any language.
22 reviews39 followers
December 19, 2014
Very good book from technical perspective, a deep insight into the most basic concepts of programming areas. good learning for the experienced professionals.
Profile Image for ifknot.
12 reviews4 followers
December 14, 2016
Okay so it's a bit old (1993) but the concepts are still very relevant I enjoyed his style and the book
Profile Image for Ray Gardener.
AuthorÌý3 books7 followers
April 18, 2017
This book was a chief inspiration for my Leveller terrain modeler, as I wanted to see if one person could develop a large application with an extremely low bug count. And the answer was yes.
Displaying 1 - 23 of 23 reviews

Can't find what you're looking for?

Get help and learn more about the design.