Organize, save, and track code for reuse

Many years ago, I started storing MP3 music. I downloaded like crazy and just dropped them all in a folder. After collecting thousands of songs, I had a big mess. After two years of organizing all the music in my free time, I moved to the "D" section of my library. I am starting to write code on a daily basis, and I would like to save a lot of what I do for reuse and future use. I often use Visual Studio and Eclipse, but also do web development. Right now, I just have a folder on the external drive called Projects , and inside this folder I have the code that I want to save, broken by its corresponding IDE, and then the language in which it was developed. It works fine right now, but I'm afraid that in a few years it will be difficult for him to navigate, and I do not want another mess, such as my music library. What are good ways to keep track of software and software projects, as well as simplify navigation and reuse in the future?

+6
code-organization code-reuse
source share
4 answers

I use the subversion repository to save code for the future. In my repository, I have the following folder structure:

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

This works for me, and I have big and small projects that I coded from high school in this repository. If, for example, I want to transfer the project that I encoded in Linux to Windows, I create a branch, which I, for example, call the Win32 port. And when I have version 1.0 of the project, I create a tag named 1.0.

Using this method, you can also set up backup scripts and save the backup in another place. (I use the cron job and some python scripts for this, but it all depends on which system the server uses.)

A book on subversion is available here freely: Link

+1
source share

Mac OS X has beautiful Snippets :

snippets http://www.snippetsapp.com/static/images/screenshots/Snippets.png

In addition, the new Xcode 4 will have built-in support for custom code snippets.

+1
source share

This will not solve your organization, but you will still be more productive using a piece of code inside Eclipse or inside Visual Studio.

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

And here is an explanation for creating them and linking to a keyword in Visual Studio 2010: http://www.visualstudiotutor.com/2010/02/create-snippet-visual-studio-2010/

0
source share

Setting up will require a bit more infrastructure and more for a few people working together, but the best approach is to start thinking about software as a service.

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

With a few exceptions, most stores do not seem to efficiently organize / share code with static document type code libraries.

It would also force you to reorganize code snippets into reusable methods, rather than random code to be copied / pasted. It also provides a clean separation between the open interface and private implementation.

0
source share

All Articles