# Bigger project and folder structure

This topic is 4728 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi all. I want to start a bigger project and want to avoid some problems from the beginning. Lets say i have several parts, like fileio, pattern, graphics, sound, scripting and so on. Should i make subfolder now? My-Project -- src ---- fileio ---- pattern ---- graphics ---- sound ---- scripting or should i put all my source files in the root-folder? How are you doing this? Thanks, ac

##### Share on other sites
Its personal preference all the way on this one. No-one can tell you how much organisation you need in your project.

I personally put all my source files in one folder. As long as I name them sensibly, I can easily find what I want just by knowing the alphabet.

Having said that, in my project work space I do use folders, and some people might think it is confusing not then using folders on disk. But thats up to them :)

Just make sure you know where your source is and you can easily find it. What method you use is, as I said, going to be different person to person.

Spree

##### Share on other sites
I use folders on disc and in the solution file. The folder structures are identicle. I'm only using folders like this now because custom include/lib directives are broken in Express Beta2. A better solution is to use seperate libraries.

##### Share on other sites
I personally think that using separate folders for different "parts" of my project is the way to go, but I usually start of with all sourcefiles in the root folder, and then when I see that the project is going somewhere, I organize it.

One thing that I always use is a separate output folder, so that my source dir doesn't get clobbered with compiler output (*.obj, *.err and stuff like that). I'm not using any IDE like DevCpp, Code::Blocks or MS Visual Studio, if you don't count make as an IDE, and I've noticed that keeping the sources in order helps me to keep the makefile more readable and easier to maintain. Separate folders for the final output both in release and debug-mode is also a nice option. But then again, it's just me... My "Downloads" folder is very structured too [smile] but that's another story.

##### Share on other sites
I use subdirectories extensively to mirror the code heirarchy in the filesystem. Keeping everything explicitly heirarchial seems to encourage modularization. I'm developing in C, so I use underscores to separate heirarchial elements in the code (in the same way / is used in the filesystem). For example, the non-static (ie: public) identifiers in the file src/res/pipe/in/ar.c are prefixed with res_pipe_in_ar. Of course, this might be more effective in C++, where you could use namespaces and the using keyword to lessen the long identifier problems with deep heirarchies.

##### Share on other sites
I once used many subfolders for a project thinking it would give me better structure. The problem is that later on you will not know where to place certain files and will have trouble finding em later on. However having 300 files in a single folder is a bit messy so my advice is to use a few very sepperate modules, such as "sound", "graphics", "math", etc. There will still be some confusion on where to place some of your files. But much less than if you have alot of folders (in my project I had like 20, and it is not recommended).

My 2 cents..

##### Share on other sites
our structure

foo -&gt;     | bin - contains files that arent added too the cvs or svn          | dbg - contains objs and other compiler things          | rel - --||--     | src     | private - contains files that arent added too the cvs or svnexternal - contains third party libsdocs - doxygen, html etcbin -&gt;     | release1     | release2     | ...     | release[n]

all src folders are made up by the foo structure

1. 1
Rutin
19
2. 2
3. 3
JoeJ
16
4. 4
5. 5

• 26
• 20
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631700
• Total Posts
3001781
×