Remember that Chet and I use a little code manager that we wrote in Ruby, that runs in the background as we code. It just watches for files that change in the source directory, and when they change, it copies them to an archive subdirectory. Each file is given a unique name based on the time it was saved, such as:
TestTextModel.cs.20021124152803 TestTextModel.cs.20021124154648 TestTextModel.cs.20021124155349
Those names will make more sense if you think of them as saying something like this:
TestTextModel.cs.2002/11/24 15:28:03
Each file just gets copied, with a new extension representing the date and time it was last modified
You may be wondering why we don't build a complex file structure, or save deltas instead of the whole file. The short answers are:
In a previous article, we mentioned that the next thing might be a simple GUI that let us click back by date and time, and put everything back the way it was. We think that might be tricky, but it seems like a good next step. Here are some other ideas for useful things to do:
Now all of these ideas may seem kind of goofy to you, so please think about them a bit. (And if they still seem goofy, or you have better ideas, please write.)
Our thinking is this. We're trying to ratchet forward in tiny steps. We start Green, write a test that goes Red, then make it be Green again. Sometimes we mess up in making it Green, and we want to start over. So we use Go Back to Green Code, Red Tests. Then we begin again.
Other times, we start with the wrong test, and then go down a bad path. So we use Go Back to Last Green Bar. Then we write a new test.
The next step along these lines could be one of two. We might just build a little Time Browser that would let us back up to a known time hack. Or, we might modify NUnit so that it logs its results to a file. That would set us up for better knowledge of changes, which we could use in the Time Browser, or even manually.
We've also talked about how to use code management when there are multiple machines editing at the same time. XP recommends "Continuous Integration", which basically means that everyone integrates their code as frequently as possible. At first look, it seems like this idea would create lots of conflict, but in fact it does not.
As the system gets larger, it becomes less and less likely that two pairs will be editing the same files. And as pairs integrate more and more frequently, conflicts also become less likely.
So the idea for the XP code manager would be this:
I freely grant that this is radical, and that it might even be a bad idea. But give it some thought and see what you think.
I'm not sure if I can express it well enough yet, but here goes:
A few folks are working on implementing parts of these ideas. I'll appreciate hearing about experiments, or just reactions. Thanks for listening.