My recent forays into coding have left me with some pretty confusing directory structures. I tend to break up my directories thusly: (I'm talking about web dev for the time being)
[myProj] - project [scr] - scripts [php and javascript files that store functionality] [mod] - modules [php scripts that will be include()d and rendered on the page] [img] - images [pictures and such] [css] - style [css files]
An avid onlooker would notice that where I can, I name my folders a three letter abbreviation of their full name. This is because I am lazy.
As my projects become more intense I am finding this to be a bit inadequate. I am beginning to wonder if there is a scalable solution? How do you analyse a directory structure to the point that you can determine if it is "good'? I assume this is a common problem so there must be many solutions.
For instance I have my lazy.js
file which I like to use across all the sites I host (of which there are a few) and I don't want to have to keep copying it into each site directory. So I employed a "common" folder.
[www] - base folder
[si1] - site 1
[scr]
[mod]
[img]
[css]
[si2] - site 2
[scr]
- you get the picture
[com] - common folder holding mysql connection script, lazy.js/php
etc
But I am wondering if this will scale well as my projects become even more complex. When I move back into Java and other compiled languages I'll have to trial-and-error my way back to a nice directory structure all over again. For web design I can include a file with an absolute path, but for compiled code how can you do that? Do you need to do that?.
So I ask all three of the people who very kindly follow this blog, what directory structures do you use? Have you figured out a way to ease the pain of multiple file includes and maintenance of? Got any resources you feel like sharing? Hit me with it yo.
In C++ atleast, I set up my projects like this:
ReplyDelete[assets]
----[gfx]
----[sfx]
----[misc]
[bin]
----[macosx]
----[win]
----[linux]
[docs]
----[documentation files]
[obj]
----[resting ground for annoying obj's]
[source]
----[project1.sln]
----[project1]
--------[etc...]
----[project2.sln]
----[project2]
--------[etc...]
This works quite well, and I often adopt some of it when creating some PHP web system.