Original Post
How do you organize your C/C++ files? I have made it very hard on myself in the past by organizing in the wrong way. I''ve organized by module theme (like player.h, game.h, input.h, etc.) and I''ve done it by programming theme (data.h, defs.h, types.h, etc.) and I''ve tried things like putting all of the code in header files in case I (or the compiler) would like to inline any, and other various ways. Inevitably something doesn''t work right, some file includes another that includes another and the compiler chokes. And then one day you want to inline a function that is in a source file and you have to move a function to a header file and the compiler chokes again because you didn''t organize your files in a nice way. I''m sure most people have experienced this at some point.
So how do you do it? And what advantages and disadvantages do you see to doing it your way? Maybe we can share some good practices and all be better organized.