never use source control before? Try it now!


Software project is developed by a team mostly, which means a tool that can make the team work efficient and enable team members to communicate in time when they are far away from each other is of great importance. In general, source control is such tool that makes the teamwork more convenient and more efficient and has some great properties to ensure the success of our project. A source control system is a place to store all the various revisions of the stuff you write while developing an application.

Source control offers tons of advantages to both teams and individuals:

First of all, it gives the team a project-wide undo button--this is of great importance. With knowing this property, my partner and I can try any code that we think it will work but are not sure of its correctness. All programmers encounter such problems: changing the code causes tons of errors, but for some reason they cannot change the code back to the original one. No exceptions for my partner and I. When we working on iteration 1, we wanted to add a pointer "next" in the "struct" of tokenType and use this pointer in our scanner.cpp file. But it turned out to be wrong and what made things much worse is that we cannot go back to the version without errors! Subversion saved our project---simply using the command "svn revert Scanner.h".

In addition, the version control system keeps a record of the changes made over time. Sometimes, I want to see changes that after my last commit--what part did my partner change? Simply using the "log" command, we can get all the information about certain file.

What's more, multiple developers can work on the same code at same time.Although when more than two people change the same part, a conflict will happen and team members have to change the code manually to solve the conflict. Most time, it works very well.

Beside advantages of source control system above, subversion has some other powerful feathers and its worth mention why you'd want to pick subversion.

From the paper "Pragmatic Version Control", I know that subversion is cheap to branch, tag and merging---it uses an efficient database model to branch and merge files, making these operations quick and painless, but in CVS, branching or labeling code requires more efforts--the server has to access and modify every file in the repository. And subversion is available for a wide variety of platforms, and most important, the server will run well on Windows--which is true cross-platform support.

There are some important things you have to know if you want to use subversion.

First, you have to use the "update" command frequently. The project is a team work and some of our teammates may work on the code when you are not. You want to make sure that you are working on the most up-to-date code every time you sit by your computer. For example, in iteration2, I forgot to update when I started, and when I wanted to commit, I was in trouble--I had to update first. Sadly, I found that my partner had already done the part I just worked on! I don't want you to get into such troubles.

Second, use "merge" properly. You and your partner can work on the same file at the same time, but if you want to commit your change but the svn says your local file is out of date, it means your partner have made some changes on this file after your last update. At this time, you need first to use "svn update" to update your local file to the most up-to-date file and then commit your changes using "svn commit -m "change file *.cpp" ". It works now! But if you and your partner work on the same part of the same file, you would not be so lucky. After you type the command "commit", you will see the conflicts between yours and your partner's. This time, you have to talk to your partner to decide which version you should use. That's what we learned and tried in labs and projects of 3081.I never use subversion before and It's so amazing. You definitely should use it!

Third, do use tags and branches. Sometimes, you want to see a previous version but the revision number is very hard to remember. That's why we give some versions that we are satisfied with a tag---name which is easy to remember. In the course 3081w, we have to do many iterations during the semester and my partner and I also put a tag on our first iteration. Anyway, tags should be read only.

"Source control is our first lag in programming", if you never use it before, you definitely should try it!


We usually email to each other what we have committed. I never used the "log" command before. It seems pretty helpful to use it. I will try that in the future. Thank you, Sunny!

We usually email to each other what we have committed. I never used the "log" command before. It seems pretty helpful to use it. I will try that in the future. Thank you, Sunny!

Fangzhou Xu

Leave a comment

About this Entry

This page contains a single entry by Yujng Sun published on October 31, 2011 8:54 PM.

Challenges of working in teams was the previous entry in this blog.

Why should we bother with unit testing? is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.



Powered by Movable Type 4.31-en