Always work with Version Control

In Uni, I had limited experience with version control. Only certain classes provide shared space for version control repository. Hopefully not too many people are experiencing the same thing. Version control is crucial. I can never understand why would any team can do their work without it.

This post is just a quick reminder to get into the habit of using version control and several reasons why I think it's important.

Two of the most popular version control used in the .Net community are subversion and Microsoft Team Foundation Server. There was also Microsoft Visual Source Safe. Out of the aforementioned products, subversion is my personal favourite.

So a little summary about them (I'll skip Visual Source Safe since it's quite an old product and it's terrible compared to the other two):

  1. Subversion - Tortoise SVN
    This is the dynamic duo! Subversion is the version control repository, whereas tortoise svn is the client. Despite no specialized features for .Net, it works really well. Subversion and tortoise Svn are very platform agnostic.

    Subversion work based on folders. It keeps track of what you put in certain folders, and maintain the same structure in its server.

    Gotcha: expect Visual Studio to regularly ask question like 'file has been modified outside visual studio'. It's a bit of the pain, but considering how good, reliable and performant Subversion/Tortoise SVN are, it's a minor pain worth baring.

  2. Team Foundation Server - Team Explorer
    Since it's a Microsoft product, this couple sits really well within Visual Studio. The version that I'm using at the moment with VS 2008 Team Edition is very usable unlike its early versions back in VS 2005. It no longer lock the file by default when you modify stuff (exclusive check out), which causes the experience of using TFS and Subversion very similar.

    TFS mainly meant to work based on the solution file. So if you want a file to be version controlled, it has to be included in the solution.
    However, there are ways to force TFS to work based on folders, which is to do all the operations through Team Explorer

    Gotcha: Always use the Team explorer to do 'get latest' or 'checking in', instead of using the Solution explorer. Remember TFS works based on the solution file. It assumes that if a file is not in your copy of solution, it won't fetch it.

    TIPS: Now and then, do a 'Get Specific Version' and choose 'latest', and overwrite everything. This is to ensure you have the latest version of every files. It feels like TFS is trying to be efficient by just sending/receiving deltas by default, and sometimes it misses stuff

Why is version controlling important?

As the name suggest, it controls version. Any serious development will take a team/developer on a journey from prototyping to the final product. More often than not, this journey will be done on a single code base. Imagine you screw things up and undo have reached its limit. What do you do? You'd hope that you have made a backup earlier, wouldn't you?

Version controlling is basically that. A regular iterative backup. Not only contains every revisions of your code base, it also can contain comments, person who checked it in, and so forth.

Version control is also useful in enabling multiple developers to work in parallel. When more than one developer modify the same file, version control will raise its flag and shout 'Conflict detected', or most times it'll happily merge the changes for you.

So there you go, a short light post about how important version control is. Don't leave home without it kids!

Further Reading

Setting up a subversion server under Windows

Running svnserve as a Windows Service

  1. says:

    So do you use Subversion for your personal projects?

    I find the server/client model a bit of an overkill for my home PC. Although it can take it, i try not to run too many servers on it.

    Is there a better solution?

  2. ronaldwidha says:

    I haven't found a better solution.

    I find having 2 shortcuts on the desktop: start svn server, stop svn server, to be very useful. So I can minimize the load of subversion server when I don't need it.