Version Control

Everybody agrees that version control (VC) is the right thing but, sadly, too often it's ignored anyway. I use version control—Git via Magit—in two ways. First, it's the primary way that I keep my machines synchronized. I could, of course, use something like Dropbox for this but Git works well for me and I've automated the process so I see no reason to change. The point is that synchronization is not something you need version control for.

The real reason for VC is that you have a history of the changes you've made and that, as a result, it's easy to drop back to a previous state if you code (or write) yourself into a box. Eric Raymond has a revealing post neatly demonstrates the virtues of version control. He writes about a “phase-of-the-moon bug” that, despite frequent and comprehensive regression tests, suddenly appeared after a commit. Nothing too strange about that but when he dropped back to the previous commit the regression tests still failed even though they had passed just a few minutes ago.

It turned out that several commits had the mysterious bug but Raymond was able to locate the culprit pretty quickly with Git bisect. Even if you're not a Git user, you could still perform the bisection process manually although a good deal less conveniently. The real enabling mechanism was VC. Without it, he'd have had a long and frustrating ordeal of trying to locate each change and test if it was the genesis of the problem.

I've heard many developers express the opinion that they don't need VC because they work alone. As Raymond's story illustrates, VC can save the day even for the lone developer1. Hop on over and read Raymond's post and see if it doesn't convince you that you should be using VC whether or not you're working alone.



The code Raymond was working on, GPSD, is, in fact, a multi-developer project but that doesn't come into play here. The story takes place while he was working alone and all the code was his.

This entry was posted in Programming and tagged . Bookmark the permalink.