Should your Source Control System understand your code?

, 2014-06-02

This week's editorial is a guest post from Phil Factor.

The fledgling computer industry did not invent source control. It merely adopted practices that were already well established in the industrial manufacturing and design industries. The design and manufacture of large, complex machines such as aircraft, tanks or motor cars required a great deal of discipline, particularly in the technical drawing of components. The engineering process involved identifying the assemblies and components in a design, and representing them in a hierarchical map. Each component was defined by its technical drawing, and the "spec" which specified the materials and manufacturing techniques. Over the course of the engineering process, they would construct and test the various assemblies, and change the drawings and specifications as required. Each version of every component had a version number, and so were born the first "version control" systems.

Source control systems have remained an intrinsic part of software development. Distributed Source Control systems have made possible the current surge of collaborative open-source software, made the rapid delivery of complex software achievable, and revolutionized team-working. Nevertheless, despite fundamental advances, using a VCS remains a necessary but frustrating experience for many. Even now, it is only too easy for the VCS to fail to sort out the merging of two simultaneous alterations of a source file, and "merge failure" is still a phrase to be dreaded by most developers.

The problem with merging boils down to the fact that the VCS still sticks to the idea of the text file as the unit of work, just as if it were the generic technical drawing or engineering specification. Comparing the textual differences between source files isn't always a good way of detecting the repercussions of a change. Without the ability to perform any a semantic analysis of the source file, it cannot, for example, judge whether a change is a code logic change, or merely the addition of comment blocks. I long for a generic version-control system that understands any language once I've added the appropriate parser as a plug-in. In the meantime, in order to achieve rapid delivery of software, some teams avoid the pain of the merge by avoiding branches altogether, and keeping all the development work in the trunk, using software "flags" to disable the functionality of the components that are not ready for release. It is like abandoning the use of a hammer because you once banged your thumb with one.

Source control has failed to keep pace with technology. We have seen a series of step-wise improvements to a process that doesn't really meet the requirements of a modern development process, and whose core concepts are more than half a century old. Intricate systems such as databases that can't easily be reduced to simple code, and designs with complex relationships between components need better source control systems that dare to think in terms of binary objects and networks. Perhaps applications need to be designed to be able able to build and test themselves to any version, and manage all their own components and assets. I know, it is enough to make any programmer nervous, but that is perhaps why source control systems have been so constant and unchanging. They are a 'thumb and blanket' in an industry that, in other aspects, is constantly reinventing itself.

Phil Factor

(Adapted from my Foreword to the forthcoming book, SQL Server Source Control Basics)


5 (1)




5 (1)

Related content


Will the next version of Windows be a "Mini-Me" version of Vista? Who knows, and it's too early to tell, but apparently there's a mini-kernel version of Windows 7, the one after Vista, which fits into 25MB on disk. That's a touch lower than the 4GB that Vista takes up. Granted it's not a full […]


60 reads

An Hour in Time

Daylight Savings time switches a little later this year. In fact it's November 4th this year, after having been in October for all of my life. In case you don't remember which way we move the clocks, here's a saying: Spring forward, fall back.

5 (1)


199 reads

Software is Like Building a House

One of the really classic analogies in software is that it's like building a house. You have a foundation, multiple teams, lots of contractors that specialize in something, etc. And it's an analogy that's debated as to its relevance over and over. I won't go into the correctness of this analogy, but I wanted to comment on it.

2012-10-08 (first published: )

293 reads