The Benefits of Source Code Management

for RuBoard

I suppose I should begin this discussion by talking about the benefits of storing your Transact-SQL code in a version control or source code management system. Some of these benefits aren't immediately obvious, so it's instructive to go through a few of them.

First and foremost, version controlling your code allows you to roll back to a previous version should you discover a bug or decide to scrap a code branch you've started. Because every version you've checked into the system is readily available, accessing a previous one is easy.

Second, version control systems usually provide difference-checking facilities. These are invaluable. When you've discovered a newly introduced coding problem and want to know what's causing it, you can check the differences between the broken version and the last one that worked, and usually find your problem. VSS has a visual difference-checking tool that places the two files side by side on the screen and highlights their differences.

Third, version control systems ensure version consistency. As you develop software and release products, your software will naturally begin to be categorized by version. Say that you discover six months after the release of a given product version that you need to compile that specific version again. Your version control system's ability to label versions and to retrieve a complete version in one step makes this a snap. You simply find the version with the label you want and instruct the system to retrieve it for you. Think about how complex this process would be without the assistance of a version control system. Once you located what you believed were the old version's source files, you'd have to check each oneperhaps hundreds or even thousands of themand attempt to ensure that not only were they from the right version of the application, but also from the same version. And this assumes that you retained the old version's source code in the first place. In essence, you'd be forced to become a human version control system. Rather than creating software, you'd spend a fair amount of your time doing things better left to computers.

Fourth, source code management systems help protect source code from accidental loss or destruction. Because the source code is typically stored in a central repository (a database of some type), it's easy to back up and much easier to manage than hundreds or thousands of files scattered across the desktop machines of a development team.

Fifth, version control systems make change management much easier. Because those who change code must check it out before changing it and must check it back in before those changes take effect, it's easy to track who's changing what in the source code. If a change was ill advised or detrimental to the application, it can be easily rolled back. If a change necessitates an explanation or comments that further detail its purpose and scope, these can be included when the file is checked back into the system. Because changes to a given source code element can only be made by one developer at a time, version control systems prevent developers from accidentally overwriting one another's changes. In short, good source code management systems help manage source code. They elevate source code management from the equivalent of a messy desk to a well-organized filing cabinet that can support the development of complex projects.

NOTE

As I write this, a new generation of version control systems is on the horizon that changes the dynamics of source code management in important ways. These new systems handle change management and other source code management duties in ways that are more conducive to large programming teams . For example, one feature that's increasingly being touted is the support for simultaneous changes to a single source code file by multiple developers. In this scenario, the version control system performs a three-way (or n -way) difference check and resolves conflicts between different versions of the same member. Obviously, this could be a real boon to large teams with large source code files. With traditional version control systems, changes to a given source code fileeven independent and unrelated changesare precluded as long as someone else has the file checked out. It's not uncommon for a developer on a large team to spend a measurable amount of time asking people to check in a code member so that he can proceed with his work. As I've said, this chapter covers source code management from the perspective of more traditional tools such as VSS, but this new generation of tools is worth keeping an eye on.


for RuBoard


The Guru[ap]s Guide to SQL Server[tm] Stored Procedures, XML, and HTML
The Guru[ap]s Guide to SQL Server[tm] Stored Procedures, XML, and HTML
ISBN: 201700468
EAN: N/A
Year: 2005
Pages: 223

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net