C++ (C++23)
Analysis against C++23 (ISO/IEC 14882:2024). Older C++ standards have substantially worse coupling properties; C++23 represents the best of what modern C++ offers.
This assessment applies the coupling account — coupling as access to a shared resource, and the coupling floor [1], [2] — and the knowledge-embodiment theorem [3]; the language is assessed against its official reference [4].
Snapshot C++ (C++23) — released October 2024 · lifecycle current
Family C++ — shelf: Systems
The language exists to control memory and hardware directly: a runtime is optional, and layout is the programmer’s business. A shelf groups; it does not classify — the tags below carry every use, paradigm, and platform of this snapshot.
Trajectory C with Classes (1979 — first implementation, Bjarne Stroustrup) · 98 (1998 — first ISO standard; templates — assessed release) · 11 (September 2011 — move semantics and lambdas, threads, smart pointers — assessed release) · 20 (December 2020 — concepts and modules) · 23 (October 2024 — ISO/IEC 14882:2024)
Tags
Use — Application, Systems, Embedded
Paradigm — Object-oriented, Imperative
Platform — Native, Embedded target
Lifecycle — Current
Memory — Manual
Typing — Static, weak
Resources
The language’s official entry points, and the documents that name the release this page assesses. A link marked this release pins the document to C++ (C++23); an unmarked link is the current reference for the language.
Landing page
Specification and reference
API documentation
Tutorial
1 Assessment
This page assesses C++ in five parts: core coupling — what the language’s own constructs force; ecosystem coupling — what the surrounding platform, tooling, and community cost; engineering readiness — whether the artifact can be reproduced, verified, observed, worked in quickly, connected to other languages, and governed openly; the profile — the unscored facts a score cannot express; and the scoring detail — the mechanism marks and the arithmetic behind every score. A ✅ bullet marks a construct that helps. A ⚠️ or ❌ bullet marks a cost; the scoring model does not price every cost named here.
Core coupling 57.7/100 · Ecosystem coupling 72.7/100 · Engineering readiness 43.3/100
Note: The score reflects C++23 with modern idioms (smart pointers ≥ raw pointers,
std::expected≥ exceptions, modules ≥ headers, concepts ≥ unconstrained templates). Teams stuck on older standards or pre-modern coding styles will experience significantly worse coupling properties.
1.1 Core coupling
1.1.1 Type
- ✅ Templates enable generic programming: Decouple algorithms from types
- ✅ RAII separates resource management: Constructor acquires, destructor releases
- ✅ Concepts (C++20) constrain templates: Clean error messages, explicit constraints decouple interface from implementation
- ✅ Modules (C++20/23) decouple compilation:
importreplaces#includeand removes header coupling, though headers remain for code not yet migrated - ✅ Deducing this (C++23): Eliminates const/non-const overload duplication
- ⚠️ Multiple inheritance still available: Diamond problem possible (though
finalspecifier helps) - ⚠️ Template metaprogramming still complex: Despite concepts, advanced templates couple to expertise
- ❌ Macros couple: Preprocessor doesn’t respect scope (though modules reduce header macro issues)
1.1.2 Construction
- ✅ Constructors separate: Copy, move, default constructors are distinct
- ✅ Move semantics decouple: Transfer ownership without copying
- ✅ Designated initializers (C++20): Named initialization decouples from parameter order
- ❌ Constructors can throw: Exception during construction couples cleanup
- ⚠️ Two-phase initialization still possible: Though discouraged by modern idioms
- ⚠️ Global state is available: static variables and singletons are permitted, though a local automatic is the default home for a value
- ❌ Collection order is unpinned: the specification fixes
std::mapin key order and leavesstd::unordered_mapbucket-local, so a program that reaches for the hash container keeps the ordering discipline itself (C5) - ❌ One value, many names: pointers and references alias freely, and a parameter, a member, and a captured pointer reach one object (C6)
- ❌ Execution moves with no call in sight: user-defined conversions run from an implicit constructor, a conversion operator, and overload resolution (C7)
- ❌ The static initialization order fiasco: a namespace-scope object reading a namespace-scope object from another unit has implementation-defined results [5] (C8)
1.1.3 Memory
- ✅ RAII decouples resource management: Destructors run deterministically, no GC needed
- ✅ Smart pointers eliminate manual delete:
unique_ptr,shared_ptrare idiomatic (manualnew/deleteis a code smell in modern C++) - ✅
std::span/std::mdspan(C++20/23): Non-owning one- and multi-dimensional views decouple algorithms from container types and memory layout - ✅ Explicit lifetime management (C++23):
std::start_lifetime_asfor safe low-level patterns - ⚠️
shared_ptrhas atomic ref counting cost: And circular references needweak_ptr - ⚠️ Raw pointer escape hatches exist: A raw pointer and a reference can alias the same object with no owner stated, though idiomatic C++23 uses spans and smart pointers (M4)
- ✅ No GC, deterministic: Full control over allocation timing
- ❌ Undefined behavior still exists: Buffer overruns, null derefs possible when using raw pointers/functions
- ❌ Storage arrives uninitialized: default-initialization leaves scalars and many class members indeterminate, and reading one before an initializer runs is undefined behaviour (M5)
- ❌ Bytes can be read as a type they never were:
reinterpret_castand unchecked downcasts reinterpret storage with no check, and the object model declares the mismatch undefined (M6) - ❌ The undeclared class has no catch: a wild pointer’s trap and a stack overflow in the template machinery end the program, outside every catch clause (Er6)
- ❌
shared_ptrcycles leak; the standard requires the cycle to be broken by hand (M7)
1.1.4 Error
- ✅
std::expectedandstd::optionalmonadic operations (C++23):and_then,transform,or_elsemake error and absence handling composable and type-safe - ❌ Exceptions still exist and remain unchecked:
std::expectedis idiomatic and preferred, but exceptions are still in the language and used in the standard library - ✅
std::stacktrace(C++23): Provides unwinding visibility, addressing historical debugging pain - ✅
std::variant: Type-safe discriminated union for error discrimination - ❌ A fault ends the program: an uncaught exception in a thread calls std::terminate (documented); the thread is a scheduling unit, not an isolation unit (Er5)
1.1.5 Concurrency
- ⚠️ Shared mutable state default: Mutexes required, though lock-free patterns are achievable
- ✅
std::jthread(C++20): Auto-joining threads with cancellation viastd::stop_token - ✅
std::latch,std::barrier,std::semaphore(C++20): Higher-level synchronization primitives - ✅
std::generator(C++23): Coroutine-based generator decouples producer from consumer - ❌ Data races are undefined behavior: No compile-time prevention (unlike Rust)
- ⚠️ Memory model still complex: Atomic operations require deep understanding
- ❌
std::threadreserves an operating-system thread: A task holds it until it ends, and a blocked task holds one too (K6)
1.1.6 Platform
- ✅ No vendor owner: The language is standardised by ISO/IEC and implemented independently by GCC, Clang, and MSVC, so no single vendor controls the standard
- ✅ No required platform runtime: A program compiles to native code and needs no C++-specific virtual machine or vendor service
- ✅ Every mainstream target is supported: Compilers and standard libraries exist for Linux, macOS, Windows, and embedded and bare-metal targets
- ✅ One source base for several implementations: Code that stays in the portable subset compiles under GCC, Clang, and MSVC, so the project is not bound to one compiler
1.1.7 Trade-offs (not coupling)
- RAII vs. Exceptions: Exception during construction couples cleanup to unwinding, may leak
- Zero-Cost Abstraction vs. Reading Time: templates and inline code remove runtime cost and add ceremony at every declaration
- C Compatibility vs. Modern Features: Legacy C patterns can couple to modern C++ code when used
- Standard Versions: C++11/14/17/20/23 couple codebases to version choices; modern C++ is largely additive since C++11
- Safety vs. Performance: a bounds check is a written call, so a team decides per loop whether to pay for it
1.2 Ecosystem coupling
1.2.1 Performance
- ✅ Zero-overhead abstraction: Pay only for what you use
- ✅ No GC: Deterministic, predictable
- ✅ Manual control: Full optimization control
- ✅ Compile-time computation: Constexpr (expanded in C++23 — now covers
std::bitset,std::unique_ptr,std::optional,std::variant,std::string,cmathfunctions) - ⚠️ Binary bloat: Templates can explode size (mitigated by explicit instantiations, LTO)
1.2.2 Ecosystem
- ⚠️ No standard package manager: CMake + Conan/vcpkg are de facto standards, but fragmentation persists
- ⚠️ Compilation speed: Templates + concepts + modules improve but still slower than Go/Rust
- ✅ Excellent IDE support: CLion, Visual Studio, VSCode with clangd — all support C++23
- ✅ Vast library ecosystem: Decades of libraries, Boost, Qt, etc.
- ⚠️ Build system convergence improving: CMake dominates; vcpkg/Conan converging
- ❌ No cross-release binary promise: libstdc++ documents that binaries built with one GNU release are incompatible with binaries built with another, and mixing C++ ABIs is not recommended [6] (Ec8)
1.2.3 Evolution
- ✅ Additive since C++11: Code from C++11+ largely compiles under C++23 (removed features are rare and deprecated first)
- ⚠️ Legacy C++98 burden: Old codebases still exist, but not a language-level problem for new code
- ✅ 3-year standard cadence: Predictable evolution (C++23 → C++26 → C++29)
- ⚠️ Feature complexity grows: Each standard adds more to learn
- ❌ Build variants multiply: #ifdef, feature-test macros, and __has_* probes select which declarations reach the compiler, so a translation unit is a flag outcome, not only a file (V7)
1.2.4 Domain
- ✅ Excellent for systems: Performance critical code
- ✅ Great for games: Industry standard
- ✅ Strong for embedded: (with care, constexpr + templates help)
- ✅ Good for high-performance: Finance, scientific computing
- ⚠️ Not for web: Rare use case
1.2.5 Learning
- ❌ Very steep: Massive language surface area accumulated over 40+ years
- ❌ C++23 idioms are learnable but the full language is not: Smart pointers,
expected, ranges, modules add to surface - ❌ Undefined behavior: Still exists and requires understanding to avoid
- ✅ Excellent resources: Effective Modern C++, C++ Core Guidelines, cppreference
1.2.6 Syntax
- ✅ Modules reduce header boilerplate:
import std;replaces many#includes - ⚠️ Template syntax:
<>remains noisy, though concepts improve readability - ✅ Designated initializers: Named member initialization improves readability
- ✅
auto, structured bindings (C++17): Reduce verbosity
1.2.7 Testing
- ✅ GTest, Catch2, doctest: Mature frameworks
- ✅ Static analyzers: Clang-Tidy, CppCheck, and MSVC Code Analysis find some undefined behaviour before runtime, though no analyzer is sound or complete
- ✅ Profilers: Excellent tooling (perf, VTune, Instruments)
- ✅
std::stacktrace(C++23): Runtime stacktrace capture improves debugging - ⚠️ Template errors: Concepts (C++20) dramatically improve error messages, but edge cases remain
1.2.8 Security
- ⚠️ Memory safety depends on idiom:
std::span,std::mdspan, smart pointers are memory-safe; raw pointers and pointer arithmetic are not - ✅ Smart pointers remove most memory bugs when the idiom is kept:
unique_ptrprevents a use-after-free and a double-free, and a raw pointer reopens both - ✅ AddressSanitizer, MemorySanitizer: Compiler instrumentation catches memory bugs at test time
- ❌ Unsafe escape hatches remain:
reinterpret_cast, pointer arithmetic, manualnew/deletestill compile (Q1) - ❌ The inherited C rule: signed overflow undefined, unsigned modulo; the optimizer exploits both (Q4)
1.2.9 Delivery targets
What ships from a producer to a consumer, and whether the interface across a release boundary is promised. Ec8 is present when one compiled target crosses with no promise.
| Target | Ships as | Crosses a producer boundary | Cross-release promise |
|---|---|---|---|
| vcpkg and Conan recipes | source | no | A recipe builds from source on the consumer machine |
| shared library | compiled | yes | no — libstdc++ documents that binaries built with one GNU release are incompatible with binaries built with another, and mixing C++ ABIs is not recommended [6] |
1.3 Engineering readiness
1.3.1 Reproducibility
- ❌ Builds embed include paths, ABI choices, and template instantiation state. (Y1)
- ❌ Libraries resolve from the system and package-manager state at build time. (Y2)
- ❌ The distribution records no compiler version per project. (Y14)
- ✅ The build description (Make or CMake) is the contract the builder reads. (Y18)
1.3.2 Supply chain
- ❌ System packages and vendored sources carry no signed provenance by default. (Y3)
- ❌ No advisory feed joins CVEs to the libraries a program links. (Y16)
1.3.3 Observability
- ❌ The standard library has no structured logging. (Y6)
- ⚠️ Tracing rides the platform (ETW, perf, OpenTelemetry SDKs), not the language.
- ❌ A fault ends in a signal or terminate; core dumps are a platform setting. (Y15)
1.3.4 Feedback
- ❌ Template instantiation and header recompilation make builds slow. (Y7)
- ❌ No debugger ships with a compiler; gdb and lldb are separate projects. (Y13)
1.3.5 Interop
- ✅ The C FFI is native to the language; any C library is callable. (Y9)
- ✅ C++ compilers target every common architecture and platform. (Y10)
1.3.6 Governance
- ❌ Semantics rest on the compiler’s conformance tables: the standard lists implementation-defined behavior, and the committee publishes no conformance suite an independent implementation runs (Y17)
1.4 Profile
Unscored, and kept separate from every score on purpose. The profile records what a mechanism price cannot express: what a running program costs, how well a coding model and an agent work in the language, and whether a safety-critical path exists.
1.4.1 Energy and cost
What this axis asks: what does a running program cost in energy and time?
1.4.2 AI and agent readiness
What this axis asks: how well does a coding model and an agent work in this language?
1.4.3 Safety certification
What this axis asks: is there a certified or standards-qualified path to a safety-critical system?
- ✅ A standards-qualified toolchain or an established safety standard covers this language.
1.5 Scoring detail
1.5.1 Core coupling Dimensions
| Dimension | Mechanism | Description | Imposed by | Present | Weight |
|---|---|---|---|---|---|
| Type | T1 |
dynamic no static check | language | — | 0 |
T2 |
weak static | language | ✅ | −8 | |
T3 |
dynamic/duck dispatch | language | — | 0 | |
T4 |
no sum types | language | — | 0 | |
T5 |
no generics | language | — | 0 | |
T6 |
no namespaces | language | — | 0 | |
T7 |
type erasure/reflection | language | — | 0 | |
T8 |
operator overloading | language | ✅ | −4 | |
T9 |
inheritance required for polymorphism | language | — | 0 | |
T10 |
no null-safety | language | ✅ | −8 | |
T11 |
no module boundary | language | — | 0 | |
T12 |
no effect tracking | language | ✅ | −8 | |
T13 |
async/sync colouring | language | — | 0 | |
T14 |
unchecked foreign boundary | language | ✅ | −4 | |
T15 |
chars are encoding units | language | — | 0 | |
| Type cost | −9.1 (−32) | ||||
| Construction | C1 |
global mutable state by default | language | — | 0 |
C2 |
no immutability by default | language | ✅ | −4 | |
C3 |
constructors coupled to allocation | language | — | 0 | |
C4 |
no constructor/validation | language | — | 0 | |
C5 |
unpinned collection order | language | ✅ | −4 | |
C6 |
aliasing by default | language | ✅ | −8 | |
C7 |
undeclared control transfer | language | ✅ | −8 | |
C8 |
no source-visible init order | language | ✅ | −8 | |
| Construction cost | −9.1 (−32) | ||||
| Memory | M1 |
manual deallocation | runtime | — | 0 |
M2 |
GC non-deterministic pauses | runtime | — | 0 | |
M3 |
no RAII | language | — | 0 | |
M4 |
no ownership model | language | ✅ | −8 | |
M5 |
uninitialized reads | language | ✅ | −8 | |
M6 |
unchecked reinterpretation | language | ✅ | −8 | |
Er6 |
uncatchable runtime fault | language | ✅ | −8 | |
M7 |
reference cycles leak | runtime | ✅ | −8 | |
| Memory cost | −11.4 (−40) | ||||
| Error | Er1 |
no structured path | language | — | 0 |
Er2 |
unchecked exceptions only | language | ✅ | −8 | |
Er3 |
errors ignored/non-exhaustive | language | — | 0 | |
Er4 |
no composable result type | language | — | 0 | |
Er5 |
no isolation unit for a fault | runtime | ✅ | −8 | |
| Error cost | −4.6 (−16) | ||||
| Concurrency | K1 |
GIL/no parallel | runtime | — | 0 |
K2 |
shared mutable state default | language | ✅ | −8 | |
K3 |
manual sync no race detection | runtime | ✅ | −8 | |
K4 |
no structured concurrency | language | ✅ | −4 | |
K5 |
no primitives | language | — | 0 | |
K6 |
thread-per-task cost | runtime | ✅ | −8 | |
| Concurrency cost | −8.0 (−28) | ||||
| Platform | P1 |
cannot function outside one vendor/domain | context | — | 0 |
P2 |
single-vendor but other uses | context | — | 0 | |
P3 |
legacy/discontinued platform | context | — | 0 | |
P4 |
poor domain fit | context | — | 0 | |
| Platform cost | 0 |
Core coupling score: 57.7/100 — 148 of the 350 inventory points are present, so the axis cost is 100 × 148 ÷ 350 = 42.3 and the score is 100 − 42.3. Each dimension’s cost above is its share of the same denominator, and the raw weight sum follows in parentheses.
1.5.2 Ecosystem coupling Dimensions
| Dimension | Mechanism | Description | Imposed by | Present | Weight |
|---|---|---|---|---|---|
| Performance | R1 |
interpreted no AOT/JIT | runtime | — | 0 |
R2 |
GC pauses | runtime | — | 0 | |
R3 |
JIT warmup | runtime | — | 0 | |
| Performance cost | 0 | ||||
| Ecosystem | Ec1 |
no package manager | context | ✅ | −4 |
Ec2 |
fragmented tooling | context | ✅ | −8 | |
Ec3 |
small/niche/discontinued | context | — | 0 | |
Ec4 |
proprietary | context | — | 0 | |
Ec5 |
platform-locked tooling | context | — | 0 | |
Ec6 |
monoculture | context | — | 0 | |
Ec7 |
legacy burden | context | — | 0 | |
Ec8 |
unpromised binary boundary | context | ✅ | −8 | |
Ec9 |
unpromised data boundary | context | — | 0 | |
| Ecosystem cost | −7.8 (−20) | ||||
| Evolution | V1 |
breaking changes | language | — | 0 |
V2 |
frozen | context | — | 0 | |
V3 |
discontinued | context | — | 0 | |
V4 |
glacial standards | context | — | 0 | |
V5 |
silent default drift | runtime | — | 0 | |
V7 |
build-variant state space | context | ✅ | −8 | |
| Evolution cost | −3.1 (−8) | ||||
| Domain | D1 |
domain/vendor lock-in | context | — | 0 |
D3 |
framework forces architecture | context | — | 0 | |
| Domain cost | 0 | ||||
| Learning | L1 |
steep | context | ✅ | −8 |
L2 |
large surface/multi-paradigm | context | ✅ | −4 | |
L3 |
sparse docs | context | — | 0 | |
| Learning cost | −4.7 (−12) | ||||
| Syntax | S1 |
verbose | language | — | 0 |
S2 |
inconsistent | language | — | 0 | |
S3 |
punctuation-heavy | language | — | 0 | |
| Syntax cost | 0 | ||||
| Testing | G1 |
weak tooling | context | — | 0 |
G2 |
poor debugging | context | — | 0 | |
G3 |
runtime-only errors | context | — | 0 | |
G4 |
no published monotonic clock | runtime | — | 0 | |
| Testing cost | 0 | ||||
| Security | Q1 |
memory-unsafe | language | ✅ | −15 |
Q2 |
dynamic/weak typing risk | language | — | 0 | |
Q3 |
known vulnerability/injection | context | — | 0 | |
Q4 |
silent integer overflow | language | ✅ | −15 | |
| Security cost | −11.7 (−30) |
Ecosystem coupling score: 72.7/100 — 70 of the 256 inventory points are present, so the axis cost is 100 × 70 ÷ 256 = 27.3 and the score is 100 − 27.3. Each dimension’s cost above is its share of the same denominator, and the raw weight sum follows in parentheses.
1.5.3 Engineering readiness Dimensions
| Dimension | Mechanism | Description | Imposed by | Present | Weight |
|---|---|---|---|---|---|
| Reproducibility | Y1 |
build not reproducible | context | ✅ | −15 |
Y2 |
dependencies not pinned | context | ✅ | −8 | |
Y14 |
no toolchain version pin | context | ✅ | −8 | |
Y18 |
no machine-read project contract | context | — | 0 | |
| Reproducibility cost | −18.1 (−31) | ||||
| Supply chain | Y3 |
no signed provenance | context | ✅ | −15 |
Y4 |
registry without namespacing | context | — | 0 | |
Y16 |
no advisory feed | context | ✅ | −8 | |
| Supply chain cost | −13.5 (−23) | ||||
| Observability | Y5 |
no stable tracing standard | context | — | 0 |
Y6 |
no structured logging | context | ✅ | −4 | |
Y15 |
no post-mortem diagnostics | runtime | ✅ | −8 | |
| Observability cost | −7.0 (−12) | ||||
| Feedback | Y7 |
slow build | context | ✅ | −15 |
Y8 |
no fast in-editor analysis | context | — | 0 | |
Y13 |
no bundled debugger | context | ✅ | −8 | |
| Feedback cost | −13.5 (−23) | ||||
| Interop | Y9 |
no foreign-function interface | language | — | 0 |
Y10 |
no portable target | context | — | 0 | |
| Interop cost | 0 | ||||
| Governance | Y11 |
single-vendor governance | context | — | 0 |
Y12 |
closed specification | context | — | 0 | |
Y17 |
no conformance mechanism | context | ✅ | −8 | |
Y19 |
no published parser | context | — | 0 | |
| Governance cost | −4.7 (−8) |
Engineering readiness score: 43.3/100 — 97 of the 171 inventory points are present, so the axis cost is 100 × 97 ÷ 171 = 56.7 and the score is 100 − 56.7. Each dimension’s cost above is its share of the same denominator, and the raw weight sum follows in parentheses.
Verdict: C++23 provides substantially better coupling than its reputation suggests. Modules decouple compilation units. std::expected provides composable error handling. Concepts eliminate template error message hell. std::span/std::mdspan provide safe non-owning views. Smart pointers are idiomatic and eliminate manual new/delete. Main strength: RAII + zero-cost abstractions + deterministic performance. Main weakness: the language retains unsafe escape hatches (raw pointers, macros, exceptions) and new features coexist with old ones, meaning teams must enforce modern idiom discipline. C++23 with Core Guidelines and static analysis is a different language from C++98.
The formal development. The definitions, theorems, and proofs behind this page are published in:
- On the Nature of Coupling: All Coupling as Shared Resource Access — Zenodo, 2026 — doi:10.5281/zenodo.21925122
- Coupling as a Consequence of Cohesion: Decomposition, the Coupling Floor, and Domain-Imposed Coupling — Zenodo, 2026 — doi:10.5281/zenodo.21925201
- On the Nature of Cohesion: Cohesion as Correctness Relative to a Partitioning Rule — Zenodo, 2026 — doi:10.5281/zenodo.21703193