When working with a SCM system, when should you branch?
Whenever you feel like it.
You probably won't very frequently if you work with a centralized SCM since the branches are part of the official repository, and that doesn't really invite much experimentation, not to mention that merges really hurt.
OTOH, there's no technical difference between a branch and a checkout in distributed SCMs, and merges are a lot easier. You'll feel like branching a whole lot more often.
It depends on what type of SCM you're using.
In the newer distributed versions (like git and mercurial), you're creating branches all the time and remerging anyway. I'll often work on a separate branch for a while just because someone's broken the build on the mainline, or because the network's down, and then merge changes back in later when it's fixed, and it's so easy to do that it's not even annoying.
The document (short and readable) that most helped me understand what was going in in the distributed systems is: UnderstandingMercurial.
In the older systems with a central repository, (like CVS, SVN and ClearCase), then it's a much more serious issue which needs to be decided at a team level, and the answer should be more like 'to maintain an old release whilst allowing development to continue on the main line', or 'as part of a major experiment'.
The distributed model is much better, I think, and lacking only nice graphical tools to become the dominant paradigm. However it's not as widely understood, and the concepts are different, so it can be confusing for new users.
There are various purposes for branching:
There are several uses for branching. One of the most common uses is for separating projects that once had a common code base. This is very useful to experiment with your code, without affecting the main trunk.
In general, you would see two branch types:
Feature Branch: If a particular feature is disruptive enough that you don't want the entire development team to be affected in its early stages, you can create a branch on which to do this work.
Fixes Branch: While development continues on the main trunk, a fixes branch can be created to hold the fixes to the latest released version of the software.
You may be interested in checking out the following article, which explains the principles of branching, and when to use them:
When you need to make significant and/or experimental changes to your codebase, particularly if you want to commit intermediate changes, without affecting trunk.
The need for branching may also arise: