4 ms·
Ask HN: How do you organize your code?
I've always created a "Development" folder in my home directory where I put project-specific folders. For example: "Development/projectA", "Development/projectB" etc.
But this approach is getting messy and I'm about to reinstall my system so I'm curious how HN users organize their code.
- truebosko 18y agoI have a similar setup to you and I agree, mine isn't optimal but it works (for now). Basically it's: /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
- ichverstehe 18y agoThrow everything in ~/work/my_awesome_hack .. you really need a lot of projects before that gets unorganized. Deprecated code that I never touch is in ~/work/_oldies.
- makecheck 18y agoI used to have projects organized in a root, but I found that I spend so much time visiting specific ones that it's easier to have them directly in home. 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.
- raju 18y agoI guess my answer is a longer one than you would want, but I will put it out here anyway... I use Windows, and the first thing I do is move my home dir to C:\home\raju. This is where everything thats I will ever need to backup resides along with another directory, C:\projects. 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/ http://looselytyped.com/2008/05/04/windows-reinstallation/ Hope this helps.
- grandalf 18y agomy main projects go in /home/myusername/ and the rest go in /home/myusername/projects/ and stuff that I'll delete soon goes in /home/myusername/test
- rcoder 18y agoI mirror all my code and projects between my home and work systems, so the layout is vaguely like this: ~/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.
- speek 18y agoThis is what I use at my office: 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.
- procyon 18y agoI primarily like using console while working on a project. I have a centralized location which is connected to my "very-rudimentary" version system. I have written small scripts which run every single time I fire up console. At times, I have project specific console scripts all reside on my desktop. I have global key shortcuts to open up consoles for commonly used projects. Simple aliases and scripting trick is kinda abstraction over the actual code organized in folders. I find it eminently helpful since I use Linux and Windows both quite frequently, so it keeps everything consistent for me.
- hs 18y agoOpenBSD + dwm + vnc here 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?