I have recently gone through a major revamp of my code repositories, both locally and remotely on GitHub and BitBucket, because I have recently come to the major realization of Why You (I) Should Organize Your (My) Code. If you’re at all like me, you probably have a bunch of folders all over your computer’s hard drive which contain random snippets of code. Ok, no, actually, I haven’t been like that in a while, I, about 6 or 7 months ago, have moved all of the code snippets on my computer to a single location, ~/Dropbox/coding, so that it is super easy to cd into it while working in a shell (which is my primary coding environment, aside from Sublime Text) - but it was still super messy and unorganized, with random git repos all over the place and so on.
After recently getting some more web development job offers recently, I realized that I really needed to get serious about the organization/public display of my code. That’s when I came up with 5 reasons why you should organize your code.
I have read many places (take hacker school for example) that to get a job in the web/programming industry, a solid GitHub account is a must. Even if you can sit down and prove that you know what you're talking about when you chat about recursive loops in ruby, you need to have a history of projects that you have done using said skill, and GitHub is great for just that.
If you were to walk into a new job as a web developer, your employer/fellow employees would expect you to have some already established habits of good code organization, so that not only you, but they are able to navigate your filesystems as well when needed.
This applies even for the people (like me) who plan to start their own business. Not only does it set me up as a good employee in case my own business fails, it gives me good habits to set and example for my employees as well.
I can safely say today that if I lost my MacBook right now, I would lose 0 code repositories, because they are all both (1) versioned on GitHub, and (2) backed up in my Dropbox. That doesn't mean I want to lose my MacBook, but it does give me a sort of insurance in case it happens.
I also have access to all of my code anytime through the Dropbox app on my phone, that means that at any time if I'm talking about how to write a FizzBuzz program in Bash, I can whip out my phone and show that I've done it, and have it displayed publicly on the internet.
Every coder at some point wants to share his code with others, whether it be with another coder to get his advice, or with a lay person to show off his work. While this is a bit of a given with services like GitHub or BitBucket, it is often too much of a hassle to upload your code to a service and sharing a link instead of just emailing the entire file/project. That is why you should already have it all versioned with git and uploaded to GitHub or BitBucket, because then it's always ready for sharing.
I don't know any coder who wouldn't say that they relied heavily on Google and StackOverflow while developing their projects. What a lot of people don't realize is that the information they get while using Google or StackOverflow is all freely given to them to learn from by a community of like-minded coders. That is exactly the purpose of the concept of Open Source code. Everyone can learn from each other's publicly displayed code, and the entire community benefits - not just your single project.
What if you died? I know I wouldn't want to be the one to sort through a disorganized mess of directory after directory of code. So, out of consideration for those who you will leave behind, make it easy to tell what is what in your code.