Ask HN: How do you organize your code?
But this approach is getting messy and I'm about to reinstall my system so I'm curious how HN users organize their code.
But this approach is getting messy and I'm about to reinstall my system so I'm curious how HN users organize their code.
/dev
- /dev/py
-+ /dev/py/projectA
-+ /dev/py/projectB
- /dev/lisp
..etc
- /dev/php
.. etc
And so forth. I like having all my code in one area but still separated enough that I can easily fetch what I need.
I also have some "global" folders for things like Javascript code, random HTML/CSS junk, and so forth
~/Projects/
/work/
/account-tools/
/courseware/
/system-mgmt/
/personal/
/blog/
/throwaway/
/org/
/fundraising/
/public-site/
(etc., etc.)The meaning of the 'work' and 'personal' directories should be apparent, and 'org' is for non-profit volunteer work.
Each project is under some sort of version control, but it could be CVS, Subversion, or Git, depending on how many years ago I last worked on it.
To answer your question, my projects directory looks a lot like truebokso's, with sub-dirs language based (with does not work all the time) and sub-directories to individual projects.
Console on windows gives you the ability to wire up the console opening up in any directory, and so I use that to get to any project I am working on at a particular point in time.
I blogged about this arrangement a while back -
http://looselytyped.com/2008/05/04/windows-reinstallation/
Hope this helps.
TPL (three letter code for client Tippingpoint Labs -> TPL)
-> ~Resources (global resource files)
-> ~Information (research for the client)
-> TPL08-01Website (client ID + last two digits of the year - job ID
---> ~Resources(resources for the job)
---> 080210 (date coded, 10th of February, 2008)
---> 080220 (date coded, 20th of February, 2008)
------> actual stuff inside
-> TPL08-02CookieRecipe
..etc
-> TPL08-999_IT
..etc
At home, I just use three directories: /school, /work, /play. School has all of my school stuff in it (it's subdivided into year and class), work has all of my work stuff in it (a less intricate version of the above), and play is just a dump where I plop files.
So now I have, e.g. ~/ProjADev instead of ~/Development/ProjectA. It's much nicer for quickly reaching them in new shells.
Under the project I typically have one subdirectory ("svn") to represent the checkout, so there's "svn/trunk", etc. This allows me to easily add project-related scrap files that clearly aren't meant to be checked in.
As for organizing what is checked in, my approach is not typical. :) For instance, I don't believe in separating headers and source files...I find it extremely inconvenient to have them in different places, so I dump them in one place.
alt+1: my main coding using vim (no mouse, no arrow key) alt+2: vncviewer to my mac mini for safari, ff3 (mouse) alt+3 ... alt+9: almost never used
i 1-1-map ~/www/pages/webapp{1,...,n) to my OpenBSD colo hg push/pull/update
i'm reconsidering attach/detach screen session between servers, but i can't stand emacs/GNU key-binding (even after xmodmap my caps to ctrl) ... anyone knows screen-like program that uses vi-keybinding?
and the rest go in /home/myusername/projects/
and stuff that I'll delete soon goes in
/home/myusername/test