Project Organization in C Best Practices

给你一囗甜甜゛ 提交于 2019-12-30 17:58:08

问题


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?

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


回答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)

Structs --> (StructA, StructB)

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

StructA --> (Methods,Struct)

etc.



来源:https://stackoverflow.com/questions/742391/project-organization-in-c-best-practices

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!