isocpp / CppCoreGuidelines

The C++ Core Guidelines are a set of tried-and-true guidelines, rules, and best practices about coding in C++
http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
Other
42.65k stars 5.43k forks source link

File extensions for modules? #2147

Open JVApen opened 1 year ago

JVApen commented 1 year ago

https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#nl27-use-a-cpp-suffix-for-code-files-and-h-for-interface-files already exists for old-style code using cpp/h files. However, there is no rule for file extensions related to modules. This is primarily important when having a codebase that mixes both behaviors.

It seems we already are introducing several extensions depending on the compiler. (Ref: https://stackoverflow.com/a/76422027/2466431)

adah1972 commented 11 months ago

I think the Core Guidelines are supposed to be a collection of best practices, so it might be a bit too early to specify which suffix should be used for modules.

MikeGitb commented 11 months ago

I think the Core Guidelines are supposed to be a collection of best practices, so it might be a bit too early to specify which suffix should be used for modules.

Actually, I think it's not too early, it's too late. I think this is one of the instances, where - due to backwards compatibility - you can't wait on some best practices emerging from its own, but have to proactively standardize things. Otherwise you just end up with 3+ different standards, that all need to be supported indefinitely in parallel.