views:

113

answers:

6

Many moons ago I started storing my music as MP3’s. I downloaded like mad and just dumped them all into a folder. After collecting thousands of songs I had a big mess. After two years of organizing all music in my free time I have made it to “D” section of my library. I am starting to write code on a daily basis and I would like to keep a lot of what I do for reuse and future reference. I use Visual Studio a lot, and Eclipse sometimes, but I also do web development. Right now I am just have a folder on an external drive called Projects and inside that folder I have code I want to save broken down by its respective IDE and then the language it was developed in. This is working ok right now, but I fear after a few years it might get hard to navigate, and I don’t want another mess like my music library. What are some good ways to keep track of code and programming projects while also promoting easy navigation and future reuse?

EDIT: 8/2/2010

BUMP!

Come on guys, there has to be other ways of storing code :)

A: 

For Mac OS X, there's the beautiful Snippets:

snippets

Also, the new Xcode 4 will have native support for custom code snippets.

jtbandes
Thought that the Visual Studio comment would have given it away, but I should have specified anyway that I am a Windows man :) This may be good info for others that read this though.
typoknig
What, you expect me to read your question that carefully? :)
jtbandes
A: 

It won't really solve your organising problem, but you'll be more productive anyway by using snippet be it inside Eclipse or inside Visual Studio.

Here's a short tutorial for snippet in Eclipse : http://www.dansshorts.com/post/creating-snippets-in-eclipse

And here the explanation to create them and link them to a keyword in Visual Studio 2010 : http://www.visualstudiotutor.com/2010/02/create-snippet-visual-studio-2010/

jmd
A: 

I use folders. :-)

Mau
A: 

The tutorial mentioned above is some what suitable with relevant contents. in older ages back up is not possible, now a day only sigle Blu ray disk can hold around 200 gb of datas http://www.agriya.com

jack
I don't wanna just store the code though, I want to store it in a masterfully organized fashion so it can be accessed later with ruthless efficiency. And what is that link for exactly? Does it have any relevance in regard to this question or is it just the shameless plug it appears to be?
typoknig
A: 

This would take a bit more infrastructure to set up and is more for multiple people working together, but the best approach is to start thinking of Software as a Service.

For commonly used functions, wrap them as a web service with good documentation. For instance, if you have a phone validator that seems to be constantly used across projects, it would become part of your validator service.

With few exceptions, most shops don't seem to organize/share code effectively with static document type code libraries.

This would also force you to refactor the code snippets into reusable methods instead of just random code that is copied/pasted in. It also gives you a clean seperation between the public interface and private implementation.

Kenoyer130
+1  A: 

I use a subversion repository for purpose of saving code for the future. In my repository I have the following folder structure:

\
|- Project1\
|- - Trunk\
|- - Branches\
|- - Tags\
|- Project2\
....

This is working for me and I have big and small projects that I coded on since high school in this repository. If I for instance want to port a project that I coded on Linux to Windows I create a branch that I for example call Win32-port. And when I have a 1.0 release of a project I create a tag named 1.0.

Using this method you can also set up back-up scripts and save a backup to another location. (I use a cron job and some python scripts to achieve this, but it all depends on what system the server uses.)

A book about subversion are freely available here: Link

ETroll
Thanks, I hear a lot about subversion, but I have never checked up on it... Guess I will now :)
typoknig