源代码目录:“common”和“包括”?
我注意到某些来源有common和/或include作为子文件夹。我特别谈论的是 C/C++ 源代码。它们应该包含什么?
I've noticed that some sources have common and/or include as sub-folders. I am talking about C/C++ sources in particular. What are they supposed to contain?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只要文件夹结构一致,任何一种方式都可以。如果源的所有者同时拥有公共文件夹和包含文件夹,则应该有明显的区别。希望这些文件夹不包含应该位于其他位置的其他工件。
您有什么特殊问题吗?或者寻找“最佳实践”?我通常认为包含文件夹包含 .h/.hpp 文件,而公共文件夹可能包含图像和其他非 .h/.hpp 共享文件。
As long as the folder structure is consistent, either way is fine. If the owner(s) of the source have both common and include folders, there should be an obvious distinction. Hopefully these folders do not include other artifacts that should be somewhere else.
Are you having a particular problem? or looking for a 'best practice'? I usually think of an include folder to have .h/.hpp files whereas an common folder could contain images and other non .h/.hpp shared files.