CppCoreGuidelines icon indicating copy to clipboard operation
CppCoreGuidelines copied to clipboard

File extensions for modules?

Open JVApen opened this issue 1 year ago • 2 comments

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)

JVApen avatar Oct 02 '23 21:10 JVApen

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.

adah1972 avatar Nov 05 '23 01:11 adah1972

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.

MikeGitb avatar Nov 05 '23 17:11 MikeGitb