January 29, 2026
Import drama, compile karma
C++ Modules Are Here to Stay
C++ says goodbye to clunky headers; commenters say 'prove the speed'
TLDR: C++20 modules let developers import code instead of juggling headers, promising cleaner projects and faster builds. The community isn’t sold: speed skeptics and precompiled‑header fans want proof, while Rust voices complain about shallow privacy; a support tracker shows modules are coming, drama or not.
C++ just dropped a big promise: modules in C++20 let you import code like Lego blocks, ditching the old #include header mess and supposedly speeding up giant builds. The post walks through how modules split public stuff from private parts and can still wrap older code with a “global module fragment.” But the comments? Pure chaos.
First, the code examples sparked roast energy. whobre saw “auto main() -> int {” and just went, “Dude…” — instant meme. Then the speed fight broke out: cmovq and others asked if anyone has actually seen faster builds, while Team PCH (precompiled headers, a speed hack) argued modules aren’t obviously better. feelamee summed it up: if the graph shows PCH is close, why bother?
Enter the Rust crowd with popcorn. reactjs_ complained that module partitions only allow one level of privacy, unlike Rust’s layered “private inside private” nesting. Translation: C++’s new system still feels flat to some.
Amid the drama, the pragmatists dropped arewemodulesyet.org to track library support. The vibe: modules are inevitable, and the cleanup is real, but devs want proof of faster builds and better structure. The memes? “import happiness” vs. “include pain,” with everyone timing compiles like it’s sports.
Key Points
- •C++20 modules allow encapsulation of libraries or namespaces without relying on #include.
- •Key concepts include translation units, module units, and explicit export declarations.
- •Module naming (e.g., dsa.rbtree) does not create compiler-recognized submodules; modules interact only via public interfaces.
- •Module partitions enable internal structuring of large modules, importable only within the named module.
- •Backward compatibility is supported via the global module fragment, allowing inclusion of non-modular code and incremental migration.