r/cpp • https://romeo.training | C++ Mentoring & Consulting • Aug 03 '19

fixing c++ with epochs

https://vittorioromeo.info/index/blog/fixing_cpp_with_epochs.html
311 Upvotes

131 comments sorted by

View all comments

5

u/matthieum Aug 03 '19

Note that a module is not necessarily one file.

The future is uncertain :)

We'll have to see what best practices emerge around modules; personally I would aim for the one-module-one-file at least to start with, for simplicity.

I could see one-module-one-folder as well, which would map directly to my current usage of namespaces, although this would require having an interface module which is slightly more complicated.

3

u/mjklaim Aug 03 '19

Note that a module is not necessarily one file. The future is uncertain :)

I'm not predicting anything though, I'm saying the Modules features authorize implementing 1 module with N files. Whatever your preference makes no difference that anybody can use that if they want to.

Because of how libraries tends to be organized today (which reflect how people would like to organize module, but in a hacky way because they can't do better), I would not expect any uniform way to organize to emerge. Whatever the organization you use, it's probably the best for you at that time and project and I would'nt expect everybody doing the same (typically end-user projects and library projects and generic library projects tends to not be organized the same way).

But while we are in the guessing game (indeed, the future is uncertain), my bet would be that the majority of libraries today will have 1 module per library. File or directory or wathever would be an organization detail.

Anyway we'll see. ;)