I thought I would post about source code management (or Source Control). After many years of developing software without it, I finally decided that I needed some source code management. Over the course of several large projects I had made sweeping changes that caused new problems and bugs. The ability to contrast the old versions of the source prior to all my changes would have helped isolate the problem.
I had also played the #ifdef game far too long - making new changes optional or at least more obvious by wrapping them in conditional precompiler directives.
I'm certainly no expert in this area, but Source Code management basically does 3 things for us:
There are several products out there that do what I require. Microsoft's rendition is Visual Source Safe. However the product I settled on is Perforce. Why? Well, because it's completely free (for up to two users).
I have been using it for a couple months now, and have been very pleased with it.
Initial setup (not per project, but initial one-time setup of Perforce) can seem a bit daunting at first. There is a service that runs on a server (or just the local workstation for small developers like me) that handles all the actual transactions. There is a standalone GUI for managing various projects. Finally there is the integrated plugin for Visual Studio that does all the work from within your usual development environments (VC++ / eVC++). Basically you have to create a user and a changelist. Once that is done everything else can be done from within eVC++, and you never even need to run the GUI management program.
Once Perforce is installed, and the service is running (as it should be all the time), you're set to do the basic 2 things required on a regular basis.
I'll stop at that, and perhaps others can post questions or experiences they have with source control.
Simply put, if you are a serious developer, which I know most of you are, you should be using source code management. There will be some point where you will need it (to restore damaged source files, step back to older working versions, etc), and it is like insurance on your investment, protecting your source code. What I explained above isn't really a guide on how to use source management, as much as to (hopefully) illustrate how little work or complexity is involved on a day-to-day basis, and to show that high-quality tools are available for free.
Dan East
I had also played the #ifdef game far too long - making new changes optional or at least more obvious by wrapping them in conditional precompiler directives.
I'm certainly no expert in this area, but Source Code management basically does 3 things for us:
- Allows multiple developers to work on the same source base at once by "checking out" and "checking in" specific source files. Only files that have been "checked out" can be modified (if so configured).
- Maintains versioning containing all changes made to the source code from "check in" to "check in". This allows you to step back to previous versions of the source, or use a program like WinDiff to compare.
- Integrates directly into the VC++ or eVC++ IDE GUI so that all this can be done automatically within your normal development environment with the smallest of user intervention.
There are several products out there that do what I require. Microsoft's rendition is Visual Source Safe. However the product I settled on is Perforce. Why? Well, because it's completely free (for up to two users).
Initial setup (not per project, but initial one-time setup of Perforce) can seem a bit daunting at first. There is a service that runs on a server (or just the local workstation for small developers like me) that handles all the actual transactions. There is a standalone GUI for managing various projects. Finally there is the integrated plugin for Visual Studio that does all the work from within your usual development environments (VC++ / eVC++). Basically you have to create a user and a changelist. Once that is done everything else can be done from within eVC++, and you never even need to run the GUI management program.
Once Perforce is installed, and the service is running (as it should be all the time), you're set to do the basic 2 things required on a regular basis.
- First is adding files to Source Control. Anytime you create a new file in eVC++ (Project->Add to Project->New) a box will automatically appear and ask you if you want to add the file to the source control system. Hit okay and that's that. For existing projects you can simply go to the FileView tab, Right Click on the name of the Project, and hit Add to Source Control.
- Second is the day-to-day checking in and checking out of the source files. For single developers this is really easy. Just check things in whenever you want to take a "snapshot" of all your source at its current point. That is done by right-clicking on the Source Files folder and selecting "Check In". It's that easy. For multiple users you would have some rules in place, such as only checking out individual files at a time (as opposed to all of them in a project), and checking files in as soon as your done with them. As a single developer I simply leave them all checked out all the time. Even if you completely exit out of eVC your source files will still be checked out if you didn’t check them back in.
I'll stop at that, and perhaps others can post questions or experiences they have with source control.
Simply put, if you are a serious developer, which I know most of you are, you should be using source code management. There will be some point where you will need it (to restore damaged source files, step back to older working versions, etc), and it is like insurance on your investment, protecting your source code. What I explained above isn't really a guide on how to use source management, as much as to (hopefully) illustrate how little work or complexity is involved on a day-to-day basis, and to show that high-quality tools are available for free.
Dan East