4 ms·
Ask HN: 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 3y agoStuff 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.
- blackhaj7 3y agoSounds like a good setup! Thanks
- legrande 3y agoHonestly 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.
- blackhaj7 3y agoOh I have plenty of project-name-new-newer-newests!
- JohnFen 3y agoI have taken to just using git's local repository. That way my version control history stays local with the project itself. I've found it to be a lot easier to manage that way than having a central repository that holds all my projects. Although I'm considering moving away from git to a different version control system, so this may change.
- interbased 3y agoI had this same issue when working with Jupyter notebooks during my data science days, but after getting used to using GitHub on a team, all my code is just neatly organized in separate folders/repositories and every update is committed. It's fairly effortless now.