开发者

Recommendations on how to organize my various web projects (rails, asp.net, binaries and git repos)

This question is more about organizing the directories/files on my computer. However, this IS a problem every programmer runs into so I thought it appropriate to ask here.

Over the least few years I've worked on many projects on many platforms (classic asp, asp.net webforms, asp.net mvc, rails, etc). Most of them are websites but some are not. These projects not only have source code but also some photoshop files, word documents, spreadsheets, etc.

I also like to clone interesting git repos I find on github.com and download source code from sourceforge.net.

My question is, how do I organize these files in a way that makes sense? Right now I have something like this:

/sourcecode
  /non_web_projects
  ...
  /websites 
    /classic_asp
      /project1/website  # the source code
      /project1/misc     # everyt开发者_开发问答hing else
      /project2/website
      /project2/misc
      ...
    /asp_net
      /project1/website  
      /project1/misc     
      ...
    /asp_net_mvc
      /project1/website
      /project1/misc    
      ...
    /rails
      /project1/website  
      /project1/misc     
      ...
    /git_repos
    ...
    /source_forge
    ...

But I feel this is a big mess. How do you guys organize your projects, source code, and related assets?


I keep all my active projects, regardless of type, directly in ~/Projects. Periodically I run this ruby script which gives me the option to either archive or junk old projects. This combination works pretty well to keep me focused on what's going on.

On caveat, I will keep projects in different places based on who the projects are for and what computer I'm on. On my personal systems I keep personal projects in ~/projects and projects for others, such as my employer in ~/client_name_here/projects. On my work computer I keep work related projects in ~/projects and that's it.

For me it is all about navigation. Getting into the correct directory should be as painless as possible. That's why I keep everything directly off of ~/Projects. I have ~ in my cd path so no matter where I am on the file system I can type cd Pro and I'm in my project folder. From there it's just a matter of cd-ing into the correct project directory.


I have mine organized something like the following:

/type(OS specific, website, application, script, etc)
  /sourcecode
    /snippets(sections of code that I use frequently in many different projects)
      /language(perl, java, batch, bash, etc)
        /version(either version number or completion date depending on the project)
    /test_code(very raw form, pieces from here may work or may complete trash)
      /language
        /version
    /dev_code(slightly more refined code, but still buggy)
      /language
        /version
    /pprd_code(code that is being tested prior to delivery to the production environment)
      /language
        /version
    /prod_code(code that is currently completed and is either being used in production or is fully ready to be placed in production)
      /language
        /version
    /patches(special patches that do not have their own specific version)
      /language
        /version
  /compiled_projects
    /test_apps(very raw form, applications here may work or may be junkers yet to be deleted)
      /language
        /version
    /dev_apps(slightly more refined applications, but still buggy)
      /language
        /version
    /pprd_apps(applications that are being tested prior to delivery to the production environment)
      /language
        /version
    /prod_apps(applications that are currently completed and are either being used in production or are fully ready to be placed in production)
      /language
        /version
    /patches(special patches that do not have their own specific version)
      /language
        /version
/graveyard(I put all code or apps that I want to delete here for at least 6mo to a year just in case I may need something that I forgot about)
  /language
    /old_project_name_expected_deletion_date


I have all my projects organized using the hierarchy \Projects\Language\SubProject, somewhat similar to what you have. There are pitfalls to this arrangement however, as sometimes a project will involve multiple components written in different languages, and moving between language folders becomes a pain.

Based on my experience a better idea is to organize by project and then by subcomponents. It seems that a hierarchical arrangement (based on file system folders) is not the best in this case. Ideally each project would have metadata such as language used, so you can filter by the metadata to drill down. I think it's important to realize that once you get past a certain number of projects you will have to rely on search functionality to quickly get to what you need.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜