Search code examples
macosfilesystemsdevelopment-environmentenvironmentdeveloper-tools

Recommended file system setup for development projects?


I just got a new computer (Mac, if relevant) and I'm in the process of downloading IDEs and other stuff intended for development. Is there a recommended pattern for setting up the file system for development?

On a different computer in the past, I just created a folder titled Development in the home directory and then all workspaces were dumped in there. There is a workspace folder for Eclipse projects and then some other folders for Xcode projects.

I searched and read this blog post that recommends the conventions for Go. Any other recommended setups?

I plan to contribute to open source projects and to have some Xcode and Java projects of my own, if any of that's relevant.


Solution

  • This might be primarily opinion based, but the folder structure I've settled on is based on my use cases. I generally have two ways I use code: experimenting with a language, and working on a project (and that project sometimes has multiple languages). Accordingly, I create two folder heirarchies: ~/Code/<language>/ for experimenting with a language, and ~/Git/<projectname>/ for projects.

    The Code might look something like this:

    Code/
    ├── Bash
    │   └── tmp.sh
    ├── C
    │   └── tmp.c
    ├── CPP
    │   └── tmp.cpp
    └── Python
        ├── multifile
        │   ├── first.py
        │   └── second.py
        └── tmp.py
    

    And the Git folder would look something like this:

    Git/
    ├── CoolProject
    └── Project1
        ├── README.md
        ├── doc
        └── src
    

    In the Code directory, I worry much less about structure or documentation. Once/If a project grows big or important enough to version control I place it in the Git directory where I try to follow the conventional folder hierarchy for the language, like your Go link, or this Python guide or whatever Eclipse would make for Java. I do try to have a README.md at the root level of each project so I'll know what it does and I can put it on GitHub easily.