𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

C++ Core Guidelines Explained: Best Practices for Modern C++

✍ Scribed by Rainer Grimm


Publisher
Addison-Wesley Professional
Year
2022
Tongue
English
Leaves
518
Edition
1
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Write More Elegant C++ Programs

The official C++ Core Guidelines provide consistent best practices for writing outstanding modern C++ code and improving legacy code, but they're organized as a reference for looking up one specific point at a time, not as a tutorial for working developers. In C++ Core Guidelines Explained, expert C++ instructor Rainer Grimm has distilled them to their essence, removing esoterica, sharing new insights and context, and presenting well-tested examples from his own training courses.

Grimm helps experienced C++ programmers use the Core Guidelines with any recent version of the language, from C++11 onward. Most of his code examples are written for C++17, with added coverage of newer versions and C++20 wherever appropriate, and references to the official C++ Core Guidelines online.

Whether you're creating new software or improving legacy code, Grimm will help you get more value from the Core Guidelines' most useful rules, as you write code that's safer, clearer, more efficient, and easier to maintain.

  • Apply the guidelines and underlying programming philosophy
  • Correctly use interfaces, functions, classes, enum, resources, expressions, and statements
  • Optimize performance, implement concurrency and parallelism, and handle errors
  • Work effectively with constants, immutability, templates, generics, and metaprogramming
  • Improve your C++ style, manage source files, and use the Standard Library

"We are very pleased to see Rainer Grimm applying his teaching skills and industrial background to tackling the hard and necessary task of making the C++ Core Guidelines accessible to more people."
--Bjarne Stroustrup and Herb Sutter, co-editors, C++ Core Guidelines

Register your book for convenient access to downloads, updates, and/or corrections as they become available. See inside book for details.

✦ Table of Contents


Cover
Half Title
Title Page
Copyright Page
Contents
List of selected C++ Core Guidelines
List of figures
List of tables
Foreword
Preface
Acknowledgments
About the author
Part I: The Guidelines
Chapter 1: Introduction
Target readership
Aim
Non-aims
Enforcement
Structure
Major sections
Chapter 2: Philosophy
Chapter 3: Interfaces
The curse of non-const global variables
Dependency injection as a cure
Making good interfaces
Related rules
Chapter 4: Functions
Function definitions
Good names
Parameter passing: in and out
Parameter passing: ownership semantics
Value return semantics
When to return a pointer (T*) or an lvalue reference (T&)
Other functions
Lambdas
Related rules
Chapter 5: Classes and Class Hierarchies
Summary rules
Concrete types
Constructors, assignments, and destructors
Default operations
Constructor
Copy and move
Destructors
Other default operations
Class hierarchies
General rules
Designing classes
Accessing objects
Overloading and overloaded operators
Conventional usage
Unions
Related rules
Chapter 6: Enumerations
General rules
Related rules
Chapter 7: Resource Management
General rules
Allocation and deallocation
Smart pointers
Basic usage
Function parameters
Related rules
Chapter 8: Expressions and Statements
General
Declarations
Names
Variables and their initialization
Macros
Expressions
Complicated expressions
Pointers
Order of evaluation
Conversions
Statements
Iteration statements
Selection statements
Arithmetic
Arithmetic with signed/unsigned integers
Typical arithmetic errors
Related rules
Chapter 9: Performance
Wrong optimizations
Wrong assumptions
Enable optimization
Related rules
Chapter 10: Concurrency
General guidelines
Concurrency
Locks
Threads
Condition variables
Data sharing
Resources
Overlooked danger
Parallelism
Message passing
Sending a value, or an exception
Sending a notification
Lock-free programming
Related rules
Chapter 11: Error Handling
Design
Communication
Invariants
Implementation
Do’s
Don’ts
If you can’t throw
Related rules
Chapter 12: Constants and Immutability
Use const
Use constexpr
Chapter 13: Templates and Generic Programming
Use
Interfaces
Advantages of function objects
Definition
Alternative implementations with specializations
Hierarchies
Variadic templates
Perfect forwarding
Variadic templates
Metaprogramming
Template metaprogramming
Type-traits library
Constant expressions
Other rules
Related rules
Chapter 14: C-Style Programming
Entire source code available
Entire source code not available
Chapter 15: Source Files
Interface and implementation files
Namespaces
Chapter 16: The Standard Library
Containers
Text
Input and output
Related rules
Part II: Supporting Sections
Chapter 17: Architectural Ideas
Chapter 18: Nonrules and Myths
Chapter 19: Profiles
Pro.typeType safety
Pro.boundsBounds safety
Pro.lifetimeLifetime safety
Chapter 20: Guidelines Support Library
Views
Ownership pointers
Assertions
Utilities
Part III: Appendixes
Appendix A: Enforcing the C++ Core Guidelines
Visual Studio
clang-tidy
Appendix B: Concepts
Appendix C: Contracts
Index
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
Y
Z

✦ Subjects


C++ Core Guidelines; C++ Programming Language; Software Development; Computer Programming; Programming Best Practices; Modern C++; C++11; C++17; C++20


πŸ“œ SIMILAR VOLUMES


C++ Coding Standards: 101 Rules, Guideli
✍ Herb Sutter, Andrei Alexandrescu πŸ“‚ Library πŸ“… 2004 πŸ› Addison-Wesley Professional 🌐 English

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++ communi

C++ coding standards: 101 rules, guideli
✍ Sutter, Herb;Alexandrescu, Andrei πŸ“‚ Library πŸ“… 2004;2011 πŸ› Addison-Wesley Professional 🌐 English

Every software development team should have and follow a coding standard.It's even better when what the coding standard requires is actually consistent, reasonable, and correct.Coding standards have many advantages: *They improve code quality. This happens automatically when following agood, simple