Author: Steven Neiland
Published:

Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

If there was one piece of advise I would give to any developer starting out, it would be to use source control. I dont care what type you use CVS, Subversion, GIT, "Visual Sourcesafe" etc, just use it.

Why is Source Control Important

Time and again I encounter environments where source control consists of a portable hard-drive, or a folder on a desktop where a copy (copies) of a complete application is stored. Often this copy is either weeks old or badly named. In particular I remember one time I needed to restore an applications code to its previous state 24 hours before. On looking in the backups folder I found that yes there was a dated copy of the application, there were in fact several. I dont remember the exact naming conventions but it went something like this.

  • app_[thedate]
  • app_[thedate]_current
  • app_[thedate]_live
  • app_[thedate]_mostcurrent

Further I has seen many examples of as little as 2 developers overwriting weeks of each others work by accident. In particular the combination of Dreamweavers ftp, a remote development server and an application framework which uses includes (eg Fusebox 3) is notorious for causing situations where weeks of work are overwritten in seconds.

The Benefits

So what benefits does source control give you? Well in answering this I am going to limit my answer to subversion which I use, although most source control systems offer the same net benefits.

Overwrite Prevention

It is impossible to accidentally overwrite someone else's work. If you are commiting code that conflicts with another developers recent code you get warned and given the option to review the conflicting code and resolve it.

Change Tracking

With source control you can see all the changes made to a code file between any other version with a line by line comparison of changes. (appropriate ide plugins required eg subclipse). Further you can see who changed what, when and why (provided the developer provides adequit comments).

Featureset/Edition Branching

If you have a need to split an application into different editions its a simple matter of creating a code branch. The flexibility this provides for maintaining editions or developing new features cannot be underestimated.

1 2

What Do You Think?

Reader Comments

Post a Comment

Comment Etiquette:

  • Please keep comments on-topic.
  • Please do not post unrelated questions or large chunks of code.
  • Please do not engage in flaming/abusive behaviour.
  • Comments that contain or appear to be advertisments, will not be published.
  • Comments that appear to be created for the purpose of linkbuilding to commercial sites will be removed.

We are all adults here so play nice.

*
*



Archives Blog Listing

Tag Listing

Learn CF In A Week

Treehouse

 
Fork me on GitHub