Shop Canis
$48.32 with 17 percent savings
Digital List Price: $57.99

These promotions will be applied to this item:

Some promotions may be combined; others are not eligible to be combined with other offers. For details, please see the Terms & Conditions associated with these promotions.

You've subscribed to ! We will preorder your items within 24 hours of when they become available. When new books are released, we'll charge your default payment method for the lowest price available during the pre-order period.
Update your device or payment method, cancel individual pre-orders or your subscription at
Your Memberships & Subscriptions

Buy for others

Give as a gift or purchase for a team or group.
Learn more

How it works

  1. Choose your delivery method
  2. Send now or schedule for later
  3. Add your personal message
  4. Recipients can read on any device

These ebooks can only be redeemed by recipients in the US. Redemption links and eBooks cannot be resold.

Added to

Sorry, there was a problem.

There was an error retrieving your Wish Lists. Please try again.

Sorry, there was a problem.

List unavailable.
Kindle app logo image

Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.

Read instantly on your browser with Kindle for Web.

Using your mobile phone camera - scan the code below and download the Kindle app.

QR code to download the Kindle App

  • C++ Coding Standards: 101 Rules, Guidelines, and Best Practices (C++ In-Depth)

Follow the authors

Follow authors for new release and deal updates, plus improved recommendations. See updates from all followed authors in Your Books.
See all
Something went wrong. Please try your request again later.

C++ Coding Standards: 101 Rules, Guidelines, and Best Practices (C++ In-Depth)

4.6 out of 5 stars (125)

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.



This title is only available on select devices and the latest version of the Kindle app. Please refer to the supported device list before purchase. Available on these devices

See all supported devices

Kindle E-Readers

  • Kindle Scribe (3rd Generation)
  • Kindle Scribe Colorsoft (1st Generation)
  • Kindle Paperwhite (6th Generation)
  • Kindle (11th Generation, 2024 Release)
  • Kindle Oasis (10th Generation)
  • Kindle Paperwhite (12th Generation)
  • Kindle (11th Generation, 2022 Release)
  • Kindle Oasis (9th Generation)
  • Kindle Colorsoft (1st Generation)
  • Kindle Scribe (2024 Release)
  • Kindle Scribe (1st Generation, 2022 Release)
  • Kindle Oasis (8th Generation)
  • Kindle (8th Generation)
  • Kindle Paperwhite (11th Generation)
  • Kindle Paperwhite (7th Generation)
  • Kindle Paperwhite (10th Generation)
  • Kindle (7th Generation)
  • Kindle (10th Generation)
  • Kindle Voyage (7th Generation)

Fire Tablets

  • Fire 7 (12th Generation)
  • Fire HD 8 (12th Generation)
  • Fire 10 HD (13th Gen)
  • Fire HD 8 (8th Generation)
  • Fire HD 10 Plus
  • Fire HD 8 (10th Generation)
  • Fire 7 (9th Generation)
  • Fire HD 8 (12th Generation)
  • Fire HD 10 (11th Generation)
  • Fire Max 11 (13th Generation)
  • Fire HD 8 (12th Generation)
  • Fire HD 10 (9th Generation)

Free Kindle Reading Apps

  • Kindle for Android Phones
  • Kindle for iPhone
  • Kindle for Android Tablets
  • Kindle for iPad
  • Kindle for Mac
  • Kindle for Web
  • Kindle for PC

Shop this series

 See full series
There are 8 books in this series.
  • Kindle Price:
    $142.97
    -
    By placing your order, you're purchasing a license to the content and you agree to the Kindle Store Terms of Use.
    Sold by: Amazon.com Services LLC

Customers also bought or read

Loading...

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.



Product details

  • ASIN ‏ : ‎ B004ISL6I0
  • Publisher ‏ : ‎ Addison-Wesley Professional
  • Accessibility ‏ : ‎ Learn more
  • Publication date ‏ : ‎ October 25, 2004
  • Edition ‏ : ‎ 1st
  • Language ‏ : ‎ English
  • File size ‏ : ‎ 7.4 MB
  • Screen Reader ‏ : ‎ Supported
  • Enhanced typesetting ‏ : ‎ Enabled
  • X-Ray ‏ : ‎ Not Enabled
  • Word Wise ‏ : ‎ Not Enabled
  • Print length ‏ : ‎ 418 pages
  • ISBN-13 ‏ : ‎ 978-0132654425
  • Page Flip ‏ : ‎ Enabled
  • Part of series ‏ : ‎ C++ In-Depth
  • Reading age ‏ : ‎ 18 years and up
  • Best Sellers Rank: #1,597,497 in Kindle Store (See Top 100 in Kindle Store)
  • Customer Reviews:
    4.6 out of 5 stars (125)

About the authors

Follow authors for new release and deal updates, plus improved recommendations. See updates from all followed authors in Your Books.

Customer reviews

4.6 out of 5 stars
125 global ratings

Customers say

Customers find the book to be one of the best about C++ and appreciate its good set of best-practices. They consider it a must-read for programmers of all skill levels.
AI Generated from the text of customer reviews

Select to learn more

18 customers mention content, 17 positive, 1 negative
Customers praise the book's content, describing it as one of the best books about C++ with a good set of best-practices to be learned. One customer notes that it presents a set of principles to program by, while another mentions it serves as a fantastic resource for developers of all skill levels.
Five StarsRead more
...That said, this book is outstanding. It was everything I had hoped the new edition of Meyers's "Effective C++"....Read more
Such a great book to pick up, flip to a random page, and read. I’ve learned so many good practices.Read more
...from reading their other books/articles, and there are many good ideas in this book, but I was expecting to agree with the authors here much more...Read more
6 customers mention readability, 6 positive, 0 negative
Customers find the book readable, with one noting it's a must-read for intermediate and higher-level programmers.
very structured and useful book.Read more
Very easy to read. Much is advice each of us have already learned through experience....Read more
...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...Read more
Great book on the methodologies and best practices that every c++ programmer should read and follow. The best advice to follow: think!...Read more

Top reviews from the United States

  • 5 out of 5 stars
    Packed with time tested great advice
    Reviewed in the United States on November 28, 2004
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    This is a must read for intermediate level and higher programmers. One of the book's strengths is its conciseness, which makes it easier to read without getting tied up in a lot of details. Because of this, the reader must take it upon himself/herself to check the readings in the supplied references (given for each rule) to completely understand the terms/idioms/ideas mentioned in the rule. This is not at all a weakness in the book, as it's purpose is to summarize the rule/guideline/practice, so they can put it to use, while leaving it up to the reader to refer to readings in the given references, to obtain a greater understanding of the ideas used in that rule. Most of the references can be found in the authors' previous works. The book also makes reference to standard time tested design patterns and ideas, so it would be good to have the text "Design Patterns" read, or close by.

    7 people found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.

    We'll check if this review meets our community guidelinesOpens in a new tab. If it doesn't, we'll remove it.

  • 5 out of 5 stars
    A must have for C++ professional (from novice to expert)
    Reviewed in the United States on September 30, 2016
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    I've been a programmer since the earliest 90's, a professional software engineer since the 2000, and I would say that book contains many of the things you learn through your carrier, exposed in a very pleasant way.

    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.

    4 people found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.

    We'll check if this review meets our community guidelinesOpens in a new tab. If it doesn't, we'll remove it.

  • 4 out of 5 stars
    Many good ideas
    Reviewed in the United States on November 16, 2004
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    I have great respect for both authors from reading their other books/articles, and there are many good ideas in this book, but I was expecting to agree with the authors here much more than I do.

    Item 0: Don't sweat the small stuff. The authors say not to overlegislate naming and bracing standards, but they also say "do be consistent" and don't mix styles. From personal experience, I can say the only way to get a group of programmers to be consistent is by "sweating the small stuff" and having well-defined policies that are strictly enforced.

    Item 1: Zero tolerance of warnings. Eliminating Level 4 warnings (in Visual C++) from a complex application (as opposed to a library intended for third-party use) is more trouble than it's worth. The authors' suggestion to decrease code readability (Examples 2 and 3) to get around these warnings is quite a bad idea, in my opinion.

    Item 59: I wish somehow there could be a better answer to the C++ namespace issue. Giving many symbols (but not all, like preprocessor macros, classes not in a namespace, etc.) two names (the qualified and the unqualified) based on where that symbol appears seems so wrong and at the very least makes searching and cut-and-pasting more difficult.

    The authors clearly prefer use of stl over custom containers (although they have not always followed their own advice), but they don't address many issues related to this, like are teams using stl supposed to use the peculiar stl naming practices across the board in all code, so stl dictates naming and all projects would use naming like some_stl_vector.push_back()? Or would code like m_object.DoSomething() be mixed together with the above statement so there really is no standard? What are programmers to do when the stl containers don't cut it and a custom container is needed? Should they write it in the stl idiom or consistent with their own naming standard?

    Many of the examples refer to std::string, and even a few use const char *, in a book like this I would prefer not to see uses of these types that are not localization-friendly, since it is a best practices type of book, after all.

    The book's proofreaders are very good but I believe they missed one error on Item 61, page 112, near the bottom: "Do not definite..." I'm assuming should be "Do not define..."

    Anyway, I do recommend this book, and I do agree with most of the items, the authors raise many good points to consider when a team is deciding on its own coding standard.

    91 people found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.

    We'll check if this review meets our community guidelinesOpens in a new tab. If it doesn't, we'll remove it.

  • 5 out of 5 stars
    One of the Best C++ Books I Have Read
    Reviewed in the United States on September 3, 2010
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    C++ Coding Standards is one of the best books about C++ that I have read, although I feel the title can be somewhat misleading. When the average programmer thinks "coding standard", their mind probably thinks of a crusty old document on their company wiki somewhere that tells them exactly how to lay out their curly brackets. This book is not that at all, but rather an awesome collection of C++ wisdom that should be useful to anyone using the language. Sutter and Alexandrescu write in a wonderful conversational style that reading this book is almost like sitting down for a chat with these two masters of C++ and software development.

    I've learned a lot from this book, and it's a fantastic resource for C++ developers of all skill levels. Highly recommended!

    2 people found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.

    We'll check if this review meets our community guidelinesOpens in a new tab. If it doesn't, we'll remove it.

  • 5 out of 5 stars
    Great Practical Advice
    Reviewed in the United States on May 19, 2013
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    Very easy to read. Much is advice each of us have already learned through experience. Many suggestions that we have not thought of but can relate to because of on the job learning. Some of the standards are violated by several of my customers and having worked in those environments it is clear how impotent the standard is. My Customers need to read this book.

    Great to have easy to read practical lessons learned documented all in one place.

    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.

    We'll check if this review meets our community guidelinesOpens in a new tab. If it doesn't, we'll remove it.

  • 5 out of 5 stars
    Think of this as a Miniature Roadmap that shows you how to avoid potholes on the roads
    Reviewed in the United States on April 26, 2014
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    Every programming language has a list of caveats and things you generally shouldn't do; although it is a bit outdated, many of the concepts are still very applicable to modern day C++ programming. However, this book really shines because it tells you the caveat and tells how what to look out for if you do decide to implement the design. So it doesn't take a "Don't ever do this" approach that many other design books take.

    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.

    We'll check if this review meets our community guidelinesOpens in a new tab. If it doesn't, we'll remove it.

  • 5 out of 5 stars
    Like having a senior dev distill their career for you
    Reviewed in the United States on November 20, 2021
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    Such a great book to pick up, flip to a random page, and read. I’ve learned so many good practices.

    One person found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.

    We'll check if this review meets our community guidelinesOpens in a new tab. If it doesn't, we'll remove it.

  • 3 out of 5 stars
    not bad, but very disappointed
    Reviewed in the United States on July 26, 2005
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    This book is for newbies. If you read a lot about c++ effective, c++ whatever series, this is not the book for you. It's not because the materials are easy, they've just been mentioned and referenced by books and internet for so LONG.

    I personally think the word "Standards" in the title is just misleading and WRONG!!. That's also the reason I had high expectation from this book, but obviously made me very upset after reading it. I guess it was still my fault, because the book is obviously not organized systematically as indicated by the title.

    So Read the book title three more times before you decide if it's the right book for u.

    7 people found this helpful
    Sending feedback...
    Thank you for your feedback.
    Sending feedback...
    Thanks, we'll investigate in the next few days.

    We'll check if this review meets our community guidelinesOpens in a new tab. If it doesn't, we'll remove it.

Top reviews from other countries

    Translated by Amazon
    See original
  • 5 out of 5 stars
    Great book - but there's a perfect time to read it
    Reviewed in the United Kingdom on November 24, 2014
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    This is a great book, it's not a reference book though.

    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

    Sending feedback...
    Thanks, we'll investigate in the next few days.

    We'll check if this review meets our community guidelinesOpens in a new tab. If it doesn't, we'll remove it.

  • 5 out of 5 stars
    かなり良い
    Reviewed in Japan on March 8, 2018
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    Scott MeyersがEffectiveシリーズで詳しく説明してくれてはいるが少し冗長になってしまっているC++のベストプラクティスの指針をコンパクトにまとめてくれていると感じた。

    この本とEffectiveシリーズ、ISOCppのCppCoreGuideline、あとGoogleのC++ Style Guideを読んでその作法に従っていれば、そのうちBjarne Stroustrupが言う「エレガントでシンプルな」コードに近づける気がする。

    日本での参考書はただの「文法の羅列」であり、言語の物知りしか生み出さないような構成になっているが、本書のような本を読まなければ良いプログラマーにはなれないのだと読み進めていくうちにますます実感した

    Sending feedback...
    Thanks, we'll investigate in the next few days.

    We'll check if this review meets our community guidelinesOpens in a new tab. If it doesn't, we'll remove it.

    Translated from Japanese by Amazon
    See original
  • 2 out of 5 stars
    Still good stuff in there but you have to be aware ...
    Reviewed in Canada on May 3, 2016
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    I really should have looked at the publication date (2005). Much of the information is out of date given C++11. Still good stuff in there but you have to be aware that not all things apply for C++11. It is not the authoritative source I was looking for.

    Sending feedback...
    Thanks, we'll investigate in the next few days.

    We'll check if this review meets our community guidelinesOpens in a new tab. If it doesn't, we'll remove it.

  • 5 out of 5 stars
    Indispensable
    Reviewed in Spain on June 4, 2015
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    Éste es uno de los libros indispensables para cualquiera que quiera programar correctamente en c++.

    Hay que tener en cuenta que no es un manual de programación, sinó que cita y argumenta las reglas esenciales para poder programar correctamente en c++.

    Sending feedback...
    Thanks, we'll investigate in the next few days.

    We'll check if this review meets our community guidelinesOpens in a new tab. If it doesn't, we'll remove it.

    Translated from Spanish by Amazon
    See original
  • 5 out of 5 stars
    Five Stars
    Reviewed in India on March 28, 2015
    Brief content visible, double tap to read full content.
    Full content visible, double tap to read brief content.

    Simple and Easy language. Clear Understandings.

    Sending feedback...
    Thanks, we'll investigate in the next few days.

    We'll check if this review meets our community guidelinesOpens in a new tab. If it doesn't, we'll remove it.

Report an issue


Does this item contain inappropriate content?
Do you believe that this item violates a copyright?
Does this item contain quality or formatting issues?