NTFS junction teaches old dogs new tricks!

During a recent project for one of my clients I had a revelation of sorts: most applications are missing multi-version support.

Paltry object versioning features places unacceptable limits on our learning, testing and creativity. By object versioning I mean file revisions, memento assertions and project versions to name a few.

While your text editor may do the enormous feat of a backup version e.g. ThingEnumerator.rb~ - how well does it support switching between the two? Extending this concept to a software project - how well does your IDE support multiple project versions? What if you need to work on different releases simultaneously?

As a result of all this poor hindsight developers are forced to use a variety of "tricks" to accomplish what should be baked in. Case in point: Visual Studio's SCC integration. Try to run multiple project revisions through it. Not possible. You must use a unique mount point for each project revision. At which point it becomes more difficult to switch between revisions. Most people choose to live with that, while others use sed scripts or some such trick...but neither has the convenience I am looking for.

Still others choose to disable SCC integration entirely. That is fine until you need to host your product in a runtime. Say your product contains a web stack, IIS for example. What do you do if you need to switch between product revisions for testing? Virtual server and directory mappings need to be changed - again scriptable...but now I've got at least two scripts to run. You can see the trend here: without built-in support the work is on you to juggle multi-version development.

There is no short term solution. But in the meantime I can share the best "trick" I know of on the Windows platform: NTFS junctions. They combine the hard and soft-link concept that's been in unix forever. You can switch project revisions in your development tools with one command:

junction c:\archives\virtualdirectory c:\archives\myproject-2.0.1.1

Unfortunately Microsoft neglected to include a junction tool with any version of Windows, but Sysinternals has one called junction. Another use I just found was to temporarily share directories. Typically I keep a public share on my dev machine where I copy stuff that people need e.g. code, binaries, etc. I just realized I could just create a junction (soft-link) from the original to my public share.

Check it out if you have time.