5 ms·
Ask HN: Which folder/directory do you store code in?
I'm doing some summer clean up and curious to hear how people store/organize their code :)
- nullindividual 2y agomacOS: /Users/userName/Developer Windows: C:\Users\userName\source If you name a folder 'Developer' in macOS, it automatically adds a little Xcode-stylized icon.
- newaccountman2 2y ago> If you name a folder 'Developer' in macOS, it automatically adds a little Xcode-stylized icon. :0
- talldayo 2y ago~/Documents/Code/
- mattbillenstein 2y ago~/src/<org-or-project>/<repo>
- deleted 2y ago[deleted]
- rzzzwilson 2y ago~/gitlab/<repo>
- rabbitofdeath 2y ago~/projects/<repo>
- vhodges 2y ago~/work/src/...
- fragmede 2y agowhat about things outside of your paid vocations?
- vhodges 2y agoSorry for the delay! I need a way to monitor discussions that isn't me polling for updates). That IS my local/personal convention. It comes from my Amiga days where we had a second partition called work: (no home directories remember). I never liked ~/Documents very much but ~/work performs the same purpose.
- TillE 2y agoI like 'proj' for my own projects, 'git' for stuff I clone and may or may not contribute to.
- ycombinatrix 2y ago~/git
- beretguy 2y ago~/Code/<repo hosting provider>/<username>/<group (if applicable)>/<project name> For example: ~/Code/codeberg/beretguy/foo_group/bar_project
- tony-allan 2y ago~/GitHub/<repo>
- synack 2y ago~/src/projectname/ for things I've written, patched, or am contributing to. ~/build/projectname/ for things I've downloaded/cloned for reading or compiling. I generally consider ~/build/ to be ephemeral and it gets deleted whenever I build a new PC or start running out of disk space. ~/src/* gets moved to ~/src.old/ roughly once every five years, just to keep things fresh. Both are still backed up.
- llmblockchain 2y agoInteresting, I came to a similar structure. ~/.src/my # my stuff ~/.src/oss # things I've downloaded, built from source, etc. I have a bash alias 'ws' that 'cd ~/.src' so most of my movement is like: 'cd my/gamedev/pong' or 'cd oss/helix', etc.
- fragmede 2y agowhy a hidden folder?
- llmblockchain 2y agoAesthetic. When you `ls` $HOME or open a Finder it's a lot nicer when things match (Documents, Videos, etc). It's weird to see that one random folder (src). I know typing a dot is annoying, hence the Bash alias.
- demondemidi 2y ago~/proj for messing around ~/github when I promote a messing around project to something i want to work on. Same structure on Mac, Linux, and Windows (except I'm in %HOME% on 'doze).
- simonblack 2y ago~/wrk/projectname/ If I haven't touched a project in a long time the 'projectname' folder gets moved to an archive disk. That prevents my /home directory from getting clogged with obsolete projects. I always try to keep my /home directory under about 10-12 gigs. /a1 is "archive-disk number one": /a1/comp is where computer code/information/manuals/etc is stored: /a1/comp/j_wrk_master is where inactive code projects are stored indefinitely '/a1/comp/j_wrk_master/projectname' If the project needs to be worked on again, the '/a1/comp/j_wrk_master/projectname' folder gets moved back to become '~/wrk/projectname' again. Rinse and repeat.
- kingkongjaffa 2y ago~/code/projectname If I have an upstream branch I tend to do ~/code/GitHub/reponame Or ~/code/GitLab/reponame Depending on where it’s hosted.
- Leftium 2y ago/s/p/ I made my project base folder path as short as possible. This reduces noise in error output, etc. Also lots of people blur their username from pathnames in screenshots. No need to do that. 'p' is short for projects 's' is a drive partition used for local copies of data synced to cloud storage (Dropbox, Google files, etc). Can be backed up less frequently. I use https://www.insynchq.com https://www.insynchq.com to prevent folders like 'node_modules' from being synced
- Leftium 2y agoI keep old projects in: /s/p/.archived I also started putting a text file in each repo like (readme.md) because I often forget either the name or purpose of a project after a few months/years.
- Leftium 2y agoOne more tip: https://github.com/ajeetdsouza/zoxide https://github.com/ajeetdsouza/zoxide is amazing for returning to recent project folders from the CLI. (Then I have a CLI command to open an explorer window. Directory Opus, actually)
- rwdf 2y ago`~/dev/` with subdirectories for personal and work projects, which are configured in my .gitconfig to automatically use the correct idents, keys, etc.