Who we are

We are the developers of Plastic SCM, a full version control stack (not a Git variant). We work on the strongest branching and merging you can find, and a core that doesn't cringe with huge binaries and repos. We also develop the GUIs, mergetools and everything needed to give you the full version control stack.

If you want to give it a try, download it from here.

We also code SemanticMerge, and the gmaster Git client.

Diff debugging revamped

Monday, January 01, 2007 Pablo Santos 1 Comments

The first version control system I ever used was Source Safe. The few things I remember about my Source Safe experience are:
- Hey, this is better than zipping code back and forth.
- Somebody has my file locked... I can't continue working.
- Check in everything when you're done.
No, at that time I was not really getting the most ouf of the version control system but now I understand old good Source Safe was not the way to go.
Most of the developers out there think about the underlying version control system (when they have one) just as a way to actually release their changes. That's it. And it is often something painful to use. Programmers don't usually enjoy using the SCM but exactly the opposite.
The thing I like the best about Plastic is that it is not a tool designed to help managers control people, but to help programmers to be more productive. Ok, you can find features to help project management, and even project control, but they are derived from programmer's productivity facilities. This is an important point to remember.
Ok, why I say that? Let me introduce the topic I'll be writing about today. I was thinking on posting about the way I use Plastic to find bugs in the code. Then I found Martin's Fowler post on DiffDebugging. Yes, whatever you think about there is always someone else who thought about it before. Ok, let's go.
Most of the people I find using SCM systems use one of the two following patterns:
- Use the SCM just to check out and check in code.
- Use a continuous integration approach.
Of course there is a huge benefit on the second approach compared to the first, because it requires a well stablished build mechanism to be present.
But both of them fail on really "helping" the programmer in his daily work. Fowler's post introduces the issue of "debugging" using diff tools. What does it mean?. Ok, as programmers we are all used to the following situation:
Hey, this was working only half an hour ago, what happened? (you can replace "half an hour" by "half a day", "week" or whatever your prefered time unit is). So if you're using a version control system you can check your file's revision history, and go back "diffing" between previous versions. It is a very handy tool to find and fix problems. With Plastic we have introduced not only a "log" or revision history, but a 3D version tree which can show both history and revision's relationships in a very handy way.
Well, it is clear that version control can even help during debugging sessions but, if you are using Source Safe, CVS or Subversion your team is probably using just one development branch: so people (as it happened on my first source control experience) just check in code when they're done. Then "DiffDebugging" is not as useful as it should be. Let me explain: using the mentioned model you just check in when everything is done, so you won't prevent the following scenario: you're working on something (still intermediate) and you have to make some major change. The usual way to prevent the it was working but now it doesn't situation is saving your code with a different name before making changes (foo.c.old, foo.c.back, foo.c.back-the-good, sounds familiar?), or even better (I wanted to say worse), commenting code in and out. This can end up with:
a) Commented code kept into the mainline for what if I need it later cases. (You won't never need it later, granted!,but the ugly commented pieces will remain there forever)
b) Programmers not getting the benefits of "DiffDebugging": problems not only arise between good revisions but also between intermediate ones, the ones the programmers are working on and will never be commited to the source code control system because they are not yet finished.
Is there a solution? Yes, there is one: branching patterns. Plastic SCM handles branching with enough agility to allow developers create as many as they want: this way they can use branch per developer or even branch per task approaches. In any of them they can check in as many times as they feel they need to (once they are used to... quite often), so DiffDebugging enters the scene again, allowing them to search for mistakes in their own ongoing work.
With extensive branching usage developers gain a big undo button allowing them to exactly check everything being modified.

Fowler states most of the time I see diff debugging is during an programming session when you have local version control. Here local version control is an added service of the regular version control system.
In fact every new age version control system will talk about private branches or sandboxes or whatever that will provide developers isolation and full advantage of DiffDebugging at the same time.
Pablo Santos
I'm the CTO and Founder at Códice.
I've been leading Plastic SCM since 2005. My passion is helping teams work better through version control.
I had the opportunity to see teams from many different industries at work while I helped them improving their version control practices.
I really enjoy teaching (I've been a University professor for 6+ years) and sharing my experience in talks and articles.
And I love simple code. You can reach me at @psluaces.

1 comment:

  1. This comment has been removed by a blog administrator.