Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

is there a resource out there that defines programming folder conventions (e.g. the 'bin' folder)?

I googled some but didn't find much. Any relevant discussion on the matter is encouraged.

EDIT: I'm primarily interested in source management, and I'm not really targeting a specific language (I was hoping to get a reference that might include what's common in the big languages [C, C++, C#, PHP, Python, etc]). Sorry, I didn't mean it to be overly vague.

share|improve this question

closed as off-topic by gnat, MichaelT, GlenH7, Kilian Foth, Ozz Sep 23 '13 at 14:48

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – gnat, MichaelT, Kilian Foth
If this question can be reworded to fit the rules in the help center, please edit the question.

1  
In what context? Source management, installation directories, ... ? –  Bobby Mar 21 '11 at 14:18
3  
And please add information about the language/environment you're targeting. –  Gary Rowe Mar 21 '11 at 14:22
    
+1 to both of those, there has to be some context to a constructive question. –  Josh K Mar 21 '11 at 14:25
    
Have you seen any example open source projects for the languages that interest you? If so, please list the projects you've looked at as examples, so we can comment on the facts you've already gathered. –  S.Lott Mar 21 '11 at 15:51
add comment

7 Answers

up vote 8 down vote accepted

Under Unix, you can have some explanations with man hier. It's the manpage about the HIERarchy.

share|improve this answer
4  
For everyone else: linux.die.net/man/7/hier –  TheLQ Mar 21 '11 at 19:44
2  
Learn something new everyday! –  Chris Mar 21 '11 at 22:00
add comment

In Java Maven offers a good set of conventions

src -> all source code goes here (under version control)
+ main
  + java -> Java packages for production code
  + resources -> Production resources (e.g Spring contexts etc)
  + webapp -> web app root
    + WEB-INF
+ test
  + java -> Java packages for test classpath
  + resources -> Test resouces (e.g. example XML outputs etc)

target -> all compiled output goes here (never under version control)

More details can be found on their website.

This has the advantage of clearly delineating what is intended for test and what is for production, and what is to be treated as source and what is merely a derived resource.

Unix

Here is a handy reference for the Unix directory structure.

share|improve this answer
add comment

I would think some general conventions would be src for source code, bin for binaries, rscr for resources, img for images, dat or data for data, lib for libraries, but it varies. If you are worried your convetion won't be understood just include in the project a text file explaining it.

Of course, you could also spell out the full name of the fold, as resources, images, source_code, libraries, scripts, and while I prefer these names, I seem to see them less often.

share|improve this answer
2  
rscr for resources? I think some of these triplet code names are the worst for naming folders. –  Josh K Mar 21 '11 at 14:24
add comment

For Linux there is a standard designed by Free Standards Group, called Filesystem Hierarchy Standard. Most of the distribution try to follow that standard.

share|improve this answer
add comment

Java "Blueprints" directory structure layout.

Guidelines, Patterns, and Code for End-to-End Java Applications

This document contains recommended conventions for structuring applications developed using Java 2 Platform, Enterprise Edition (J2EE platform) technology (hereafter referred to as J2EE applications). The J2EE 1.4 Specification (which can be downloaded from http://java.sun.com/j2ee/1.4/download.html#platformspec) indicates that certain files, such as deployment descriptors, class files, interface files, and other files, must be present as part of an application. However, this specification does not specify a recommended or required directory structure for these files. The guidelines in this document are intended to assist developers with organizing the files and directories associated with an application in a logical fashion. Organizing your applications as shown in these guidelines will make it easier to manage and maintain a project, especially when multiple developers contribute to the same project or projects are maintained during an extended lifetime. Having a predefined, consistent, standard workspace layout saves time, especially at the onset of a project.

share|improve this answer
    
Just looking at that diagram makes me weep for J2EE. If I had to work in that structure I'd probably leave. –  Gary Rowe Mar 21 '11 at 21:39
    
We use Figure 2.1: Web Applications: Recommended Directory Structure (scroll down). It's not THAT bad. That first one is ugly though. –  jmq Mar 21 '11 at 22:04
add comment

Aside from the suggestions already made, if I have understood correctly you're worried about directory conventions during the development of software/web apps. For the most part (depending on how you have designed it), the only people affected by this setup is the developers. I personally would suggest that while you become familiar with any standards that may exist you also work out a system that works for you and your team if there's more than just you. Be consistent once you have determined this setup.

If I have misunderstood and you're concerned with installation architecture then do follow the standards which have been outlined for Linux/Unix... The windows standards are missing but not usually hard to figure out.

share|improve this answer
add comment

The book Brownfield Application Development in .Net gives a number of suggestions for organizing directory trees for projects.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.