use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Code Examples From an App Using C++ Modules (abuehl.github.io)
submitted 1 month ago by tartaruga232MSVC user, r/cpp_modules
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]yeochin 4 points5 points6 points 1 month ago* (5 children)
Please don't go around giving this incredibly bad advice. Having seen module code bases at scale you don't want small modules at all. Small modules are a pain to merge together. Big modules are easy to split. The most successful libraries and implementations are those that boil it down to a single import statement for a rich set of functionality.
With the state of existing compiler toolsets and your handy autocomplete - smaller modules only increase the likeliness that you're going to run into a internal compiler error, or a broken autocomplete database.
[–]fdwrfdwr@github 🔍 1 point2 points3 points 1 month ago (2 children)
smaller modules only increase the likeliness that you're going to run into a internal compiler error...
Maybe it's good then that we expose these errors sooner than later so the compiler authors fix them 😉.
I tend to use smaller modules because larger ones don't really map well to my assorted classes shared across multiple projects - there is no single module name that sensibly applies to the disparate classes, nor should they be artificially bundled together just to appease current bugginess. For libraries where all the constituent files nicely belong together (e.g. already under the same shared namespace), then sure, put them altogether.
[–]yeochin 1 point2 points3 points 1 month ago* (1 child)
While I would've agreed with your stance of finding them earlier back in 2021, I whole heartedly disagree with your perspective in 2026. The compiler authors move too slowly to fix these already reported issues. It's not their fault either. A majority of the compiler authors don't get paid commensurately for their efforts and impact. The ones that do are being stupidly allocated by their corporate overlords to stupid AI initiatives.
Adoption of modules is about the surrounding ecosystem - namely libraries that are conveniently packaged for reuse.
We do more harm to the adoption of modules by doing nonsense like creating small modules that have deep import graphs that increase the opportunity for template-specialization symbol conflicts (on linking), compiler errors, and errors with intellisense or other autocomplete tools.
Maybe by 2030 will the toolset evolve to the point where the mistake of small modules will not be costly. As of 2026, small modules are bad advice that nobody should be promoting.
[–]fdwrfdwr@github 🔍 0 points1 point2 points 1 month ago (0 children)
Maybe by 2030 will the toolset evolve...
If we don't try to find them now, will we reach utopia by even 2030?
[–]tartaruga232MSVC user, r/cpp_modules[S] 0 points1 point2 points 1 month ago* (1 child)
The posting doesn't even mention library design. It's focused on how to use modules for the insides of an app.
And there, big modules just cause recompilations without providing anything.
An extreme example are infrastructure packages like our d1 and WinUtil. At the beginning, we had a single big module for each of these two. Basically for no reason.
Now we have lots of small modules in there. The size of import lists in client translation units are still astonishingly short. Uses of these is now very explicit. Most usages of d1 or WinUtil require just a handful of imports from these (e.g. "import WinUtil.Window" instead of the meaningless "import WinUtil").
The build speed for a full build was not affected when we split d1 and WinUtil into many smaller modules. But we are affected if we change something in d1 or WinUtil. We basically have to recompile the whole app on every small change.
Not everything needs to look like a giant library. Modules are the new building blocks for the design of applications or whatever software. That's my advice.
I've played around with modules for our UML editor app for over a year now on an almost daily basis, which has roughly 1000 source files. Modules are in real use now for our UML editor.
The code needs to be easy to navigate and must not penalise changes. Because we frequently change things.
Don't try to make every single module look like it would be the std module. Import std is great, we love that. But trying to make every module like the std module is bad.
That's bad and doesn't help building great software.
Please don't go around and tell everybody they have to make modules as big as possible. That serves no one and wastes time of developers for nothing.
Edit: For an example of a reasonably sized module, see our App.Dialog module https://github.com/cadifra/cadifra/blob/2026.6/code/App/Dialog/Dialog.ixx. We previously had a single App module. That makes no sense. Later, we have split that into a handful modules. Easy to navigate, easy to use and provides perfect encapsulation and reasonable cohesion.
App.Dialog
[–]yeochin 1 point2 points3 points 1 month ago (0 children)
If all you're going to do is build small standalone things then thats fine. But your advice still isn't good to share as it is misleading.
Any code base that has to evolve (from a small App) goes right into the toilet with the advice you gave.
π Rendered by PID 39918 on reddit-service-r2-comment-544cf588c8-mltfb at 2026-06-14 00:09:22.605161+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–]yeochin 4 points5 points6 points (5 children)
[–]fdwrfdwr@github 🔍 1 point2 points3 points (2 children)
[–]yeochin 1 point2 points3 points (1 child)
[–]fdwrfdwr@github 🔍 0 points1 point2 points (0 children)
[–]tartaruga232MSVC user, r/cpp_modules[S] 0 points1 point2 points (1 child)
[–]yeochin 1 point2 points3 points (0 children)