We all (hopefully) use some sort of source control at work. If you don’t, talk to someone about it (consider the potential cost of having to recode a day, week, or month’s worth of work) or find a new job. Seriously. There are few feelings worse than having to rewrite something because the original source was lost or overwritten.
But that’s not really what I want to talk about here. Source control at home serves multiple purposes, and free options exist so one can set up a system without breaking the bank.
I have been running my own source control at home for pet projects since I was in school, and I have gone through several iterations of tools:
At work, we use TFS 2010, and I have used TFS 2005 and 2008 in the past at work as well. Obviously, given that most of my work is done in a .NET-centric environment, and that that leads me to use Visual Studio to develop more often than not, more Microsoft products appear in the list than others. However, I will say that for home use, I have found Mercurial to be the most straightforward and low-maintenance solution that I have used. TFS is great, but it requires a little too much overhead for a single developer on a home machine to warrant dealing with the relative complexity to something like Mercurial (in my opinion and experience, obviously. If you disagree, leave a comment and we can discuss it further.)
In all, I have used Mercurial for about three years, and having it in tandem with TortoiseHg, I get a similarly well-integrated experience as I get with TFS. Files are checked out automatically when I begin editing them, and I can initiate a commit, compare to previous versions, and more, all right from within VS.
How does this help?
Something that I have learned over the years is that, while source control is good for its intended use (keeping multiple developers coding in the same codebase in sync,) it also serves another purpose when coding either in a group or alone: retaining file history over time. This allows for historical analysis to be performed, and some interesting results can often be found.
With this in mind, I will be starting a recurring topic on code review this week. In it, I will analyze code that either I have written or that I have come across one way or another; please submit requests if you want, to email@example.com and I will take a look. Anything that isn’t originally mine will be attributed properly, unless the author requests to remain anonymous.
Stay tuned for first installment…