7

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?

Wooble
  • 87,717
  • 12
  • 108
  • 131
ubiquibacon
  • 10,451
  • 28
  • 109
  • 179
  • @jtbndes Added, also added subjective tag. – ubiquibacon Jul 29 '10 at 08:19
  • I was thinking about the same problem today. It's not really custom tailored to this purpose, but I am going to start using google docs to store my code snippets, since I already have a google account. I'd love to see some good answers to this question, in case there's something better. – Merlyn Morgan-Graham Jul 31 '10 at 06:23
  • I have a couple of friends (who are admittedly better programmers than myself) who use Google Code, but I have never been a big fan of online services like that. If everything hits the fan I want all my stuff with me, not on some distant server. – ubiquibacon Jul 31 '10 at 09:08
  • Incidentally, do your MP3s have metadata? If so, there are lots of products that will organize it for you – JoelFan Aug 02 '10 at 11:12

4 Answers4

1

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

snippets
(source: snippetsapp.com)

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

Community
  • 1
  • 1
jtbandes
  • 115,675
  • 35
  • 233
  • 266
  • 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. – ubiquibacon Jul 29 '10 at 08:25
1

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
  • 328
  • 4
  • 11
0

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
  • 877
  • 8
  • 12
0

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
  • 6,874
  • 9
  • 51
  • 73