Blog 3

| No Comments

Source control is of vital importance to a group of developers working on the same project, the same file, or maybe even the same few lines of code at times. In a scenario with no version control at all it is very easy to destroy the work of others. Imagine this: John and Joe are working on the same file at the same time. Joe doesn't think that an array will be an effective data structure for a heapsort so he begins to change it to a tree node representation. At the same time John is tracing an off by one error back to its source, using a debugger. After Joe has been remaking the algorithm for about 45 minutes, Joe finishes, saves, runs his test cases and breathes a sigh of relief. About two minutes late John locates the source of his problem, and changes an equal than or greater sign to an equals sign and then saves. Suddenly all of Joe's programming was for naught. Joe's new heapsort was overwritten by a slightly modified old one. This is why version control is of great importance. If they had been using a version control system like Subversion this mistake could easily have been avoided or rectified in a matter of seconds. Subversion would have noticed the conflict in the different codes submitted and asked for a resolution. In a slightly different scenario let us suppose that Joe's new heapsort algorithm didn't work at all. Either his fundamental idea was unrealistic to begin with or it just hasn't been executed properly at all. Then he has destroyed his old mostly working code in favor of new code that doesn't work at. He can either try and fix his current code, or try to remake the old code. Both cases will involve some amount of pain. With subversion he could simply roll back to the previous version with a simple command like "svn merge -r:10:9". This also simplifies experimenting with your code greatly. Sometimes you have to radically alter your code in a way that may or may not work. This is just a great big undo button for large portions of code. Previously I would have been reluctant to change great swathes of code but this way I know that
I can get back to a version that will absolutely work without fear, or making a big mess of my code with long commented out portions.

Leave a comment

About this Entry

This page contains a single entry by marqu245 published on November 17, 2011 1:50 PM.

Blog 2 was the previous entry in this blog.

Blog 4 is the next entry in this blog.

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