Menu

📰
0

Code Examples From an App Using C++ Modules

C++·/u/tartaruga232·about 1 month ago
#coPN38mp
#reddit#modules#using#code#article#discussion
Reading 0:00
15s threshold

This demonstrates usage of our recommendations for using modules:

  • Prefer small modules
  • Only use partitions if you really must
  • Avoid using internal partitions

The intention is to show some real code for context of discussions about using C++ modules.

My goal is not to sell modules. If you prefer not using modules: Use header files. There are good reasons to continue using them.

For me, C++ source code is an asset. The intrinsic value of code using modules is higher (lower entropy), as modules are a higher abstraction, compared to header files, which are basically just the pasting of C++ code into translation units (I've done that for ~36 years now).

Using C++ modules comes at a cost though. Understanding modules requires a certain level of understanding, which isn't needed when using the simple model and tradition of header files.

submitted by /u/tartaruga232
[link] [comments]
Read More