Book

C++ Coding Standards

📖 Overview

C++ Coding Standards presents 101 rules and best practices for writing professional C++ code. The book combines the expertise of two veteran C++ developers who have refined these guidelines through decades of real-world experience. Each coding standard is presented as a self-contained item with clear rationales, examples, and practical implementation advice. The standards cover key areas including resource management, exception safety, inheritance, templates, and patterns. The text balances theoretical principles with pragmatic concerns that arise in production environments. Code samples demonstrate both correct implementations and common pitfalls to avoid. This work stands out for its focus on writing maintainable, portable C++ code that performs well across different platforms and compiler versions. The authors emphasize practices that lead to robust systems while acknowledging the trade-offs inherent in different design choices.

👀 Reviews

Readers appreciate the book's concise item-by-item format and practical advice for professional C++ development. Many note its value for intermediate to advanced programmers rather than beginners. The explanations behind each guideline receive particular praise. Likes: - Clear rationale for each standard - Focus on modern C++ practices - Strong emphasis on exception safety - Code examples that demonstrate problems and solutions Dislikes: - Some find the content dated (pre-C++11) - Several readers note overlap with other coding standards books - Advanced topics can be challenging to grasp - Some guidelines are controversial among readers Ratings: Amazon: 4.5/5 (84 reviews) Goodreads: 4.1/5 (238 ratings) Notable reader comment: "Unlike other standards books that just list rules, this one explains the 'why' behind each recommendation" - Amazon reviewer Some readers recommend pairing it with "Effective C++" by Scott Meyers for a more complete understanding of C++ best practices.

📚 Similar books

Effective Modern C++ by Scott Meyers A guide for writing professional C++11/14 code through illustrative examples of patterns, idioms, and common pitfalls.

C++ Templates: The Complete Guide by David Vandevoorde, Nicolai M. Josuttis A reference for template metaprogramming techniques and best practices that form the foundation of modern C++ design.

Large-Scale C++ Software Design by John Lakos A systematic approach to designing and implementing maintainable C++ code for large systems with focus on physical design and scalability.

Modern C++ Design by Andrei Alexandrescu An exploration of advanced C++ programming techniques using templates, generic programming, and design patterns.

Exceptional C++ by Herb Sutter A collection of practical solutions to C++ programming challenges that demonstrate proper memory management, exception safety, and resource handling.

🤔 Interesting facts

🔹 Andrei Alexandrescu also wrote the influential book "Modern C++ Design," which introduced revolutionary template programming techniques and established the concept of "policy-based design." 🔹 The book was co-authored with Herb Sutter, who chairs the ISO C++ standards committee and is known for creating the "Guru of the Week" series on C++ programming. 🔹 Many of the coding standards presented in the book were battle-tested at companies like Microsoft, where Herb Sutter worked as a lead architect for C++/CLI, Visual C++, and C++ AMP. 🔹 Alexandrescu went on to create the D programming language, which incorporates many of the design principles and best practices discussed in the book while addressing some of C++'s limitations. 🔹 The book contains exactly 101 rules, a number chosen deliberately to mirror the famous "Design Patterns" book's pattern count, making it easier for developers to remember and reference specific guidelines.