8

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?

user90052
  • 2,550
  • 3
  • 16
  • 7

3 Answers3

3

You may be interested in answers to this question.

Community
  • 1
  • 1
mouviciel
  • 66,855
  • 13
  • 106
  • 140
1

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.

Kredns
  • 36,461
  • 52
  • 152
  • 203
-2

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.

Jason
  • 452
  • 4
  • 9