Private Workspace

The concept of a private workspace is central to all version control tools. Centralized version control systems provide developers with a private place to work by giving them a working copy. A DVCS takes this one step further by giving them a private copy of the whole repository.

Why is the notion of a private workspace so important?

Table 5.1. Lines of Communication

People1410
 
LinesNone645

The most productive developer is alone. A solitary developer never has to worry about coordinating with anyone else. But as soon as the project goes plural, there is overhead.[15] And for every developer added to the team, the overhead gets worse.[16]

It is the job of the VCS to help manage this overhead and minimize the effects. The primary way it achieves this goal is to give the developer the ability to pretend, for a little while, that he is the only member of the team. The VCS provides a private workspace.

Once again, this concept is similar to multi-threaded programming, where we get maximum performance when we avoid thread synchronization as much as possible. A thread can get a lot of work done during the times when it doesn’t have to wait on other threads. The thread can pretend, for a little while, that it is the only thread in its process.

By giving developers a private copy of the entire repository, the DVCS opens up much more flexibility for the kind of things they can do in their private workspace. Instead of just editing files in the working copy, developers can use all 18 of the basic verbs (see Chapter 2, Basics).

For example, a developer using a DVCS can commit as often she wants. The act of committing a change to a repository instance is distinct from the act of publishing that change to the rest of the team. The developer can pretend, for a little while, that she is the only person on the team, deferring the overhead of coordination with others until she is ready to push her work to the central server.



[15] It seems wrong to discuss this concept without mentioning “The Mythical Man-Month”, a classic book on software engineering by Fred Brooks.

[16] The function is n*(n-1)/2.