C最佳实践中的项目组织

时间:2023-01-13 12:07:39

I am wondering what the best practices are for organizing a large C project are. It is a professional project, not an open source one, likely to be stored in a Git repository. How should things be sorted? Where should structures go? When should one use functions attached to structures versus functions that take a structure as a parameter?

我想知道组织一个大型C项目的最佳实践是什么。它是一个专业项目,而不是一个开源的项目,可能存储在Git存储库中。应如何分类?结构应该去哪里?何时应该使用附加到结构的函数与将结构作为参数的函数?

In terms of laying out the files in the project, how should things come together? What naming conventions are most appropriate?

在布置项目中的文件方面,应该如何结合起来?哪种命名约定最合适?

3 个解决方案

#1


You may be interested in answers to this question.

您可能对此问题的答案感兴趣。

#2


I think the best thing to do in your situation is just make sure your whole team is on the same page. This point can't be stressed enough. Have a standardized method of doing things and make sure your doing it.

我认为在你的情况下做的最好的事情就是确保你的整个团队都在同一页面上。这一点不够强调。有一个标准化的做事方法,并确保你这样做。

#3


For large projects, my personal method is that everything gets its own folder. i.e.:

对于大型项目,我的个人方法是一切都有自己的文件夹。即:

Root --> (Classes, Structs)

根 - >(类,结构)

Classes --> (ClassA, ClassB)

类 - >(ClassA,ClassB)

Structs --> (StructA, StructB)

结构 - >(StructA,StructB)

If needed, you can further split up a StructA or Struct B...

如果需要,您可以进一步拆分StructA或Struct B ......

StructA --> (Methods,Struct)

StructA - >(方法,结构)

etc.

#1


You may be interested in answers to this question.

您可能对此问题的答案感兴趣。

#2


I think the best thing to do in your situation is just make sure your whole team is on the same page. This point can't be stressed enough. Have a standardized method of doing things and make sure your doing it.

我认为在你的情况下做的最好的事情就是确保你的整个团队都在同一页面上。这一点不够强调。有一个标准化的做事方法,并确保你这样做。

#3


For large projects, my personal method is that everything gets its own folder. i.e.:

对于大型项目,我的个人方法是一切都有自己的文件夹。即:

Root --> (Classes, Structs)

根 - >(类,结构)

Classes --> (ClassA, ClassB)

类 - >(ClassA,ClassB)

Structs --> (StructA, StructB)

结构 - >(StructA,StructB)

If needed, you can further split up a StructA or Struct B...

如果需要,您可以进一步拆分StructA或Struct B ......

StructA --> (Methods,Struct)

StructA - >(方法,结构)

etc.