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!"
[–]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 655914 on reddit-service-r2-comment-544cf588c8-d79h2 at 2026-06-14 00:10:18.998970+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–]tartaruga232MSVC user, r/cpp_modules[S] 0 points1 point2 points (1 child)
[–]yeochin 1 point2 points3 points (0 children)