These comments on this subject have appeared on LinkedIn:
Arjen Markus
consultant at Deltares (former name: WL|Delft Hydraulics)
https://www.linkedin.com/groups?viewMem … ID=4046922
8000 lines or 40 files are not all that much, as far as I am concerned, but since you find it hard to cope with, I will try to give you at least some suggestions:
- Make sure you store the sources and build scripts in a version control system. Probably best after rearranging the files. There is a wide choice of VCS's nowadays.
- Make sure you have one or more Makefiles/Solutions+project files/whatever is appropriate for your development environment, so that building the program is started merely by pressing a button in the IDE or typing a single command.
- You can probably divide the sources in separate directories, grouped logically according to the nature of the code. That will reduce the clutter.
- You may consider putting several source files into one, but I would do that only if they are related strongly enough, not just for the purpose of reducing the number of files.
- Make sure the files have relevant names, so that you can easily recognise them.
But, perhaps most practical of all, get to know the contents of these source files, so that you can easily find the one you need.
------------
Jouni Karjalainen
PhD student at University of Oulu/Dept. of Physics
https://www.linkedin.com/groups?viewMem … D=14139594
I agree 100 % to what Arjen Markus wrote. My current project is roughly double the size with about 110 files and 17000 lines of code, excluding libraries written by others. I do not consider it large at all.
I use CVS for version control and GNU Autotools for the build process etc. but there are probably more sophisticated, modern or simpler options available.
I would not recommend using 'include' for adding regular subroutines. In case you want to separate the implementation from the interface, a better way is to define the interfaces in modules and use separate source files for the implementations. Possibly you could move the implementations to a separate folder/folders if desired? That may slightly complicate the compilation/build, though.