On the one hand you’ve got the more traditional style of source control such as PVCS that uses an exclusive check-out model. Only one person is allowed to modify a file at once. It’s a safe pessimistic locking model (directing). On the other hand there’s systems such as CVS that allow multiple users to edit the same file at the same time. It’s an optimistic locking model (enabling). Yes, there can be merge problems. That alone keeps some people from using them.
I’ve used both forms of source control. Merge errors can and do happen with optimistic locking, but they’re not usually a problem. You’re notified right away and the fix is usually obvious. On the other hand, when I’ve used pessimistic locking systems, I’m often having to go talk to other developers to ask when they can check a file in because I also need to make an edit to it. In the meantime my flow is broken and I have a choice to work on something else until they can check in, or work around the source control system to make edits on a local version. Then I’ll have to remember what I changed and re-create it later when I can check the file out.
This draws a nice parallel to the perennial favorite blogging topic of static vs. dynamic typing. Static typing is like an exclusive locking source control system. It is safer, but it can get in your way — how frequently is open to debate, but I say it often does. Dynamic typing plus unit tests is like an optimistic locking source control system. It doesn’t get in your way and you can go faster, but it will sometimes have problems that your unit tests should catch right away and allow you to fix.
This brings into question Glenn’s whole premise that neither side is really right — it’s just about tradeoffs. I feel much more comfortable saying that optimistic locking in a source control system is categorically better than pessimistic locking than I am saying that dynamic typing is categorically better than static typing, but why? Is it a limit in the metaphor or in the industry’s experience with dynamic typing? Also, is there a corelation between fans of static typing and fans of pessimistic locking?