C++ Coding Standards: 101 Rules, Guidelines, and Best Practices 1st Edition
|
Herb Sutter
(Author)
Find all the books, read about the author, and more.
See search results for this author
|
|
Andrei Alexandrescu
(Author)
Find all the books, read about the author, and more.
See search results for this author
|
Use the Amazon App to scan ISBNs and compare prices.
Enter your mobile number or email address below and we'll send you a link to download the free Kindle App. Then you can start reading Kindle books on your smartphone, tablet, or computer - no Kindle device required.
-
Apple
-
Android
-
Windows Phone
-
Android
|
Download to your computer
|
Kindle Cloud Reader
|
Frequently bought together
Customers who viewed this item also viewed
What other items do customers buy after viewing this item?
Editorial Reviews
From the Back Cover
Consistent, high-quality coding standards improve software quality, reduce time-to-market, promote teamwork, eliminate time wasted on inconsequential matters, and simplify maintenance. Now, two of the world's most respected C++ experts distill the rich collective experience of the global C++ community into a set of coding standards that every developer and development team can understand and use as a basis for their own coding standards.
The authors cover virtually every facet of C++ programming: design and coding style, functions, operators, class design, inheritance, construction/destruction, copying, assignment, namespaces, modules, templates, genericity, exceptions, STL containers and algorithms, and more. Each standard is described concisely, with practical examples. From type definition to error handling, this book presents C++ best practices, including some that have only recently been identified and standardized-techniques you may not know even if you've used C++ for years. Along the way, you'll find answers to questions like
- What's worth standardizing--and what isn't?
- What are the best ways to code for scalability?
- What are the elements of a rational error handling policy?
- How (and why) do you avoid unnecessary initialization, cyclic, and definitional dependencies?
- When (and how) should you use static and dynamic polymorphism together?
- How do you practice "safe" overriding?
- When should you provide a no-fail swap?
- Why and how should you prevent exceptions from propagating across module boundaries?
- Why shouldn't you write namespace declarations or directives in a header file?
- Why should you use STL vector and string instead of arrays?
- How do you choose the right STL search or sort algorithm?
- What rules should you follow to ensure type-safe code?
Whether you're working alone or with others, C++ Coding Standards will help you write cleaner code--and write it faster, with fewer hassles and less frustration.
About the Author
Herb Sutter is the author of three highly acclaimed books, Exceptional C++ Style, Exceptional C++, and More Exceptional C++ (Addison-Wesley). He chairs the ISO C++ standards committee, and is contributing editor and columnist for C/C++ Users Journal. As a software architect for Microsoft, Sutter leads the design of C++ language extensions for .NET programming.
Andrei Alexandrescu is the author of the award-winning book Modern C++ Design (Addison-Wesley, 2001) and is a columnist for C/C++ Users Journal.
Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.
Product details
- ASIN : 0321113586
- Publisher : Addison-Wesley Professional; 1st edition (October 25, 2004)
- Language : English
- Paperback : 240 pages
- ISBN-10 : 9780321113580
- ISBN-13 : 978-0321113580
- Item Weight : 14.7 ounces
- Dimensions : 9.8 x 6.2 x 15.1 inches
-
Best Sellers Rank:
#384,766 in Books (See Top 100 in Books)
- #150 in C++ Programming Language
- #1,068 in Computer Programming Languages
- #1,703 in Computer Software (Books)
- Customer Reviews:
Customer reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
101 rules, mostly described in one or 2 pages make it a good reading before fall asleep, a good reminder of best practices that should not be forgotten. In these times, where code reviews are part of our daily activity, being aligned and focused makes the job more easy.
For novice it's for sure a good set of best-practices to be learned. For intermediate-expert it provides a clean and well focused reasoning on every single rule, good for tutoring and nice nuts of knowledge.
A must have.
It is easy to appreciate the authors' collective expertise and listen intently to the common sense and lessons learned through their experiences--all nicely wrapped up in this convenient package.
Inside are numerous quotations (proverbs?) that speak to the common sense of this book, such as: "If you have a procedure with ten parameters, you probably missed some."
In some ways, one may think that this book competes with Meyers' "Effective" series. While there certainly is some overlap, in a world plagued with bad code and bad coding standards and practices, one can argue that there can not be enough emphasis on raising the bar.
This book clearly puts forth a bar and explains the why's and why not's of its placement. I encourage every C++ programmer to buy and read this book cover-to-cover.
I must say I'm a bit dissapointed. Not because this isn't a good book, which it is, but because it's not as good as the previous ones. It seems like the author didn't expect the readers from learn that much from the Exceptional C++ series... so he explains things that seem obvious if you read those book.
One example: "Don't memcpy or memcmp non-PODs". Who would ever do such as thing other than a newbie?
Anyway, if you are wondering whether or not you should buy this book: If you completed the previous ones (and made all the exercises), just don't. Not because is not good, but because you don't need it.
If you are fluent in C++ but by no means a guru yet, go for the book. Make an effort to revise a bit of your own code following its advice. You are likely to be surprised with the results.
The only reason I did not give it 5 stars is that now and then the language is just too clunky. In particular, I had to read "...the name lookup for that operator function might reach out into the name space...Whether it reaches out into N..." a few times before I understood that "reaching out into" is meant to be a synonym for "reach into".
On the whole, however, the book is quite readable, and the code examples hit the sweet spot of demonstrating the topic of discussion without being overly long.
I've learned a lot from this book, and it's a fantastic resource for C++ developers of all skill levels. Highly recommended!
Top reviews from other countries
Many C++ books are crap, they don't cross what I call "the Hello World gulf" this is the huge gap between examples and whatnot and actual programs and useful stuff.
This book helps the crossing. You should be okay on the Hello World stuff and just starting to write programs that do stuff (by this I mean have an IDE and GUI programs that respond to input, you know actual stuff - Eclipse CDT and WxWidgets FTW!) you'll pick this book up and find some of them are things you already do, or have already picked up without being told they are worthy of report.
The ones you don't know will be explained so well you can see why you'd want to do it that way.
There are other reviews praising this book already and I don't want to re-iterate those again (consider me in chorus with them though) this book is one of the best C++ books out there because it's actually useful in crossing that gulf.
Alec
The biggest problem with these preaching items was the general lack of code examples with them, and the generic descriptions given of a potential situation deemed requiring whatever the "standard" they are specifying, without any example code these items really came across as quite obtuse and without as much merit as those with code examples.
This is not to detract from those good items inside, and there are some, they usually have clear code examples are explained concisely without seeming to preach the author(s) ideals upon you. Many of these I identified with easily and will note them down for inclusion in my own work - this does make the book worth reading.
However, with a choice between this text or perhaps one from Scott Meyers, I would take Mr Meyer's books over this, even his older books eclipse this text with their given examples and concise presentation.
Another surprise with this book was its lightness, it is actually very thin, I had expected a rather more weighty tome. I don't know why I had this impression, perhaps because other AW products are weighty, but when this appeared and was a quite thin, smaller than A4 profile, floppy back (its not even soft back, its a floppy book) I was surprised.
I would have liked to perhaps give the book 3.5 stars, its more than just "ok" as it has input into my working practices, but its not worth the full "good" 4 stars rating due to the quality and the incessant nagging of some of the items.
Overall an excellent and easy to follow book, a must read for all levels of C++ programmer.











