DEV Community

Herb Wolfe
Herb Wolfe

Posted on

How to organize programming projects?

I'm slowly working on getting my assortment of code organized, so I can put some of it on github. I have stuff scattered all over, most in a code directory, but some in other directories I've copied over from various other sources.

I read

and several other articles that came up in a google search, so I'm starting fresh with a ~/dev/ directory, and giving each project their own directory. However, I have some projects I've done in multiple languages, for a example, a guess the number game in Java, and bash. I also did a few of the problems on Project Euler, and at least one I solved in more than one programming language.

I'm wondering what the best or recommended practice is for naming projects done in multiple languages. For example, should I create separate directories for the number guessing game, named guess-java, guess-shell, etc, or should I nest them, for example guess\java & guess\shell even though a lot of the advice I read was to not group projects by language

Top comments (1)

Collapse
 
joellau profile image
Joel Lau

I've been struggling with this as well, and re-organize my directories every year or two, or when its starting to get out of hand.

The best solution I came up with was to first put every project in a repository - this way, you can track changes, and add documentation where required. On my local machine, I also split projects by where the repositories are hosted (github, bitbucket, etc..) so that I can use a .gitconfig file to control what credentials are being used when a project is open in my text editor and / or IDE.

I also delete local copies of my code when I'm not using them any more, just to reduce the clutter and free up some mental load.

However, you'll still face the issue of having to give a unique name for each of your projects - one of the hardest things to do in our field 😂😂