Chuanqi says "The data I have obtained from practice ranges from 25% to 45%, excluding the build time of third-party libraries, including the standard library."[1]
[1]: https://chuanqixu9.github.io/c++/2025/08/14/C++20-Modules.en...
If these aren't compelling, there's no real reason.
Program
- Module
- Module Partition
whereas in module systems that support module visibility, like Rust’s, you can decompose your program at multiple abstraction levels: Program
- Private Module
- Private Module
- Private Module
- Public Module
- Public Module
Maybe I am missing something. It seems like you will have to rely on discipline and documentation to enforce clean code layering in C++."Just one more level bro, I swear. One more".
I fully expect to sooner or later see a retcon on why really, two is the right number.
Yeah, I'm salty about this. "Submodules encourage dependency messes" is just trying to fix substandard engineering across many teams via enforcement of somewhat arbitrary rules. That has never worked in the history of programming. "The determined Real Programmer can write FORTRAN programs in any language" is still true.
Rust, Modula-2 and Ada are probably the only ones with module nesting.
Log scale: Less than 3% done, but it looks like over 50%.
Estimated completion date: 10 March 2195
It would be less funny if they used an exponential model for the completion date to match the log scale.
It seems likely I’ll have to move away from C++, or perhaps more accurately it’s moving away from me.
How well does this usually work, by the way?
The current solution chosen by compilers is to basically have a copy of your code for every dependency that wants to specialize something.
For template heavy code, this is a combinatorial explosion.
So no, modules aren't even here, let alone to stay.
Never mind using modules in an actual project when I could repro a bug so easily. The people preaching modules must not be using them seriously, or otherwise I simply do not understand what weed they are smoking. I would very much appreciate to stand corrected, however.
whobre•1h ago
Dude…
on_the_train•1h ago
Night_Thastus•40m ago
whobre•7m ago
cpburns2009•14m ago
> auto main() -> int
Isn't that declaring the return type twice, once as auto and the other as int?
yunnpp•9m ago
There is, however, a return type auto-deduction in recent standards iirc, which is especially useful for lambdas.
https://en.cppreference.com/w/cpp/language/auto.html
auto f() -> int; // OK: f returns int
auto g() { return 0.0; } // OK since C++14: g returns double
auto h(); // OK since C++14: h’s return type will be deduced when it is defined
CamperBob2•1h ago
few•59m ago
Davidbrcz•57m ago
webdevver•3m ago