Friday, August 12, 2011

An incomplete history of source code version control from SCCS to Mercurial

Once upon a time, in the 1970s, there was SCCS. It was big on PDP-11's and the like.

Then came RCS, which could do version control for individual files, but not for entire projects.

Finally, CVS arrived in the 1980s and people said "ok, finally we have something that can be credibly called source code version control."

And people used CVS for a good long while. And it was way better than not having version control.

But there were some problems.

Turns out that giving multiple people the ability to travel through time and alter the history of incredibly complicated documents with complex interdepencies can have a few wrinkles to it. Who woulda thunk it?

So, once we all survived Y2k, SVN was created, to be pretty much just like CVS, but working correctly.

Whole teams could work on projects, and fork, and branch, and all sorts of lovely things, all out of a central repository. A rich ecosystem built on SVN; IDEs integrated SVN functionality; issue tracking systems linked in so that commit messages could update the status of bugs; and vice versa. And not only is it well understood how to operate the software, even the business processes around code management using SVN are well understood and documented - for example, a very pragmatic book about it.

And that went pretty darned well for a good long while. Talk about mature!

But then Linus came along and started an open source project with thousands of contributors all around the world. Mind-bogglingly large scaling issues here. In fact, it had to be distributed - there couldn't be a single central store. And this just exceeded SVN's capabilities. 

So Linus created Git. And lo, Git is mighty. It can handle just about everything you can imagine. It's used by nearly everyone who operates at that scale, and all the open-source hackers who want free hosting at places like Google Code and Github. The best practices are mature.

So, here's the state of play these days:

SCCS and RCS are legacy software, like COBOL - still plays a valuable role, but generally not chosen for any new implementations.

There are old CVS implementations out there, often cursed at by the poor programmers who haven't been able to convince their management to upgrade to SVN. CVS is kind of the Internet Explorer 6 of version control systems these days.

Most enterprises have at least SVN (or some commercial equivalents, like the version control built into Visual Studio) and it's hard to think of an IDE with version control support that doesn't support SVN.

Many modern IDEs have added native support for GIT; tons of tech companies are using it. Including some folks who are pretty hard-core.

And there's an incredibly elegant system called Mercurial (Hg). Many people like to compare and contrast Git and Mercurial.

So, here we are, with Subversion, Git and Mercurial as obvious choices to select from, whether you're an open source project looking for free hosting on Google Code, a one person iPhone developer, or a Fortune 500 company.

If you care, here are links to my delicious tags for:

(Did you notice I only discussed open source version control systems? Yeah. I said it was incomplete.)

Architecture & The Book of Five Rings

Miyamoto Musashi's The Book of Five Rings is a classic text of the martial arts, written in 17th century Japan. I'm reading Thomas Cleary's excellent translation.

Cleary argues that Musashi intended his work to apply not just to fighting, but to every endeavor of life. I'm certainly seeing the applicability to IT architecture:
The carpenter is used as a metaphor in reference to the notion of a house. We speak of aristocratic houses, military houses, houses of the arts; we speak of a house collapsing or a house continuing; and we speak of such and such a tradition, style, or "house." Since we use the expression "house," therefore, I have employed the way of the master carpenter as a metaphor.
The world of carpenter is written with characters meaning "great skill" or "master plan." Since the science of martial arts involves great skill and master planning, I am writing about it in terms of comparison with carpentry. 
If you want to learn the science of martial arts, meditate on this book; let the teacher be the needle, let the student be the thread, and practice unremittingly.  
Likening the Science of Martial Arts to Carpentry
As the master carpenter is the overall organizer and director of the carpenters, it is the duty of the master carpenter to understand the regulations of the country, find out the iregulations of the locality, and attend ot the regulations of the master carpenter's own establishment.  
The master capenter, knowing the measurements and designs of all sorts of structures, employs people to build houses. In this respect, the master carpenter is the same as the master warrior.
When sorting out timber for building a house, that which is straight, free from knots, and of good appearance can be used for front pillars. That which has some knots but is straight and strong ca be used for rear pillars. That which is somewhat weak yet has no knots and looks good is variously used for door sills, lintels, doors, and screens. That which is knotted and crookend but nevertheless strong is used thoughtfully  in consiration of the strneght of the various members of the house. Then the house will last a long time. 
Even knotted, crooked, and weak timber can be made into scaffolding, and later used for firewood.  
As the master carpenter directs the journeymen, he knows their various levels of skill and gives them appropriate tasks. Some are assigned to the flooring, some to the doors and screens, some to the sills, lintels and ceilings, and so on. He has the unskilled set out floor joists, and gets those even less skilled to carve wedges. When the master carpenter exercises discernment in the assignment of jobs, the work progresses smoothly. 
Efficiency and smooth progress, prudence in all matters, recognizing true courage, recognizing different levels of morale, instilling confidence, and realizing what can and cannot be reasonably expected — such are the matters on the mind of the master carpenter. The principle of martial arts is like this.
You can include IT under that metaphor just as easily as martial arts.
The Science of Martial Arts 
Speaking in terms of carpentry, soldiers sharpen their own tools, make various useful implements, and keep them in their utility boxes. Receiving instructions from a master carpenter, they hew pillars and beams with adzes, shave flors and shelving with planes, even carve openwork and bas relief. Making sure themeasurements are correct, they see to all the necessary tasks in an efficient manner; this is the rule for carpentry. When one has develop practical knowledge of all the skills of the craft, eventually one can become a master carpenter oneself. 
An essential habit for carpenters is to have sharp tools and keep them whetted. Is is up to the carpenter to use these tools masterfully, even making such things as miniature shrines, bookshelves, tables, lamp stands, cutting boards, and pot covers. Being a soldier is like this. This should be given careful reflection. 
Necessary accomplishments of a carpenter are avoiding crookedness, getting joints to fit together, skillful planing, avoiding abrasion, and seeing that there is no subsequent warping. 
If you want to learn this science, then take everything I write to heart and think it over carefully.