HACKER Q&A
📣 blackhaj7

How do you organize your code?


I have a new computer and want to start fresh so I am looking for inspiration.

On my old computer I stored everything under ~/code

This got unwieldy so I then had a few folders: ~/code/focus ~/code/bin ~/code/2023 etc

How do you organize your code?

Got any other organization tips e.g. on dotfiles?


  👤 JohnFen Accepted Answer ✓
Stuff that I'm actively working on is in ~/dev. Once I'm no longer actively working on it, I move it to ~/Projects with a subdir name that is the name of the project. I don't do any further organization than that because filesystem tools make it easy for to find things from there.

All project notes are in a Wiki I host on my main server. These notes include where the project files are being stored. In practice, the wiki is my primary gateway/index to the projects.

The one hiccup to this is with projects that aren't software-only. CAD files, PCB layout files, photos, etc. I don't put them in ~/dev because in my mind, that's for software. So I just put them straight into ~/Projects. It's not ideal to have project files split like that, but I haven't come up with a better solution yet.


👤 legrande
Honestly it's a mess. I still do unwieldy naming schemes like:

    PROOJECT1-FINAL-WORKING-COPY-A
    PROJECT2-NEW-FINAL-V1
    PROJECT2-NEW-FINAL-V2
But once it's on Github, it automatically gets version controlled, so I can roll back to a working state if I make a mistake.