If programmers wrote programs the way builders built buildings, then Gerald Weinberg would have to work outside and wear a hardhat.
Some developers use source control systems like Visual SourceSafe only on very large teams. After all, the main feature of source control is to prevent multiple developers from overwriting each other's code changes, and small teams usually don't have nearly as big a problem with that as larger teams do. But that belief isn't entirely accurate. There are also other benefits of using a source control system, including benefits that apply to teams even as small as a single developer. In fact, a good source control system is one of the most important tools developers have.
Properly used, source control systems can prevent many common errors from ever getting into your code. They can help project leaders understand and control what changes are being made to the code, or they can manage the complexity inherent in working on multiple versions of a product at once. And finally, source control systems can be surprisingly helpful when debugging. Visual SourceSafe may not seem like a debugging tool, but I've pinpointed and fixed hundreds of bugs using it and nothing else.
Visual SourceSafe is not the only source control tool available. Dozens of other vendors offer similar products, and some of them have additional features over SourceSafe that may be worth a look. But since everyone with Visual Studio .NET already has SourceSafe, this chapter will assume that's what you're using. Still, nearly all the debugging techniques in this chapter are applicable to other source control systems, too.
In this chapter, we're going to look at Visual SourceSafe. For the benefit of readers who've never used it before, we'll first briefly review the major concepts and advantages of source control. Experienced developers may want to skip ahead a few pages. But after that, we'll return to debugging and see how source control can be used to pinpoint bugs, manage the delivery of bug fixes to customers without disrupting development of your current version, and even assist in catching bugs before you check them in. Along the way, we'll also look at methods for organizing your code in SourceSafe that simplify the process of maintaining multiple versions.