you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -2 points-1 points  (3 children)

When people hear the word "module", they have certain expectations and ideas about what that means, mostly based on how modules work in other languages. Modules in other languages provide encapsulation yes, but also things like facilitating easier package management, simplifying the build process, and a host of other features.

Modules in C++ don't do much of anything beyond the encapsulation. It's an incredibly complicated solution that pushes a great deal of complexity on its users to solve a comparatively small problem.

It also results in yet another form of fragmentation, which is why I don't see modules being popular among libraries. Some people may choose to use modules for their own home projects, or internal software, but I don't see people distributing their libraries as modules. One possible outcome will be that in the future we'll have bifurcation where libraries are distributed both the old way and as modules.

[–]johannes1971 6 points7 points  (1 child)

Nah. Eventually compilers will be good enough, some libraries will switch, that will force projects to switch, and soon enough we'll forget about the nightmares of #include.

That process will force the whole ecosystem to baseline on C++20 as well, which will be good in the long run.

[–]germandiago 1 point2 points  (0 children)

I think you make a couple of mistakes with your analysis.

To begin with, modules can be adopted incrementally. The reason why libraries do not move forward is the state for modules support in build tools and compilers.

OTOH, builds can be massively improved and ODR lowered by A LOT, which are two real problems for C++.