10.3. A Lab Note Mechanism
Alice: One more thing.
Bob: I was afraid you would say that. What is it now? Don't we have
all the pieces we need to get started, and more?
Alice: This will be the last ingredient, I promise. I won't insist on
documentation, literate or coherent or otherwise. But what I do insist
on is a systematic way of keeping lab notes.
Bob: Lab notes? For which lab? What notes?
Alice: Our toy model and its environment will form a kind of lab for
your students. They can perform experiments, by setting up initial
conditions, running a simulation, and analyzing the results. It is
all virtual of course, but apart from that, the procedures and the
skills needed are not that different from doing a lab experiment.
Bob: I remember burning my fingers while learning how to blow glass
during my freshman physics class. After glass stops to glow, it is
still incredibly hot. I sure wished that I had infrared eyesight then.
But okay, if you want to stretch metaphors, I've burned myself with
hasty programming as well. And there are parallels between lab work
and working with software. Or in astronomical terms, between working
with a simulation or with a telescope. If you walk into an astronomer's
office, and see a pretty picture on his or her screen, you have no way
of knowing, a priori, whether you're looking at an observation
or a simulation. So I grant you that a lab is not such a bad metaphor,
after all. But what about your notes?
Alice: I suggest that each time we get together to work on our toy
model software, we keep some notes about the main decisions we make,
and the reasons behind them. That will not take much time, and it
will help us writing documentation later on. What is more, it will
enable us to go back and trace down why we did what we did, when we
come back to a piece of code a few weeks later, trying to debug it,
and wondering why we ever wrote this or that.
Bob: Now that sounds easy. We can just scribble down some notes
while we go along. Probably better to write that in a file somewhere,
rather than on scraps of paper.
Alice: Ideally, we should do better than that. As part of a coherent
programming approach, it would be good to combine computer code AND
documentation text AND lab notes, all in one environment, with many
pointers from each of the two to the third element in the triangle.
But again, I won't try to convince you. All I'm asking for is that we
both keep notes, together when we are working jointly, and individually
when one of us extends something in our toy model environment.
Bob: I have no trouble with that. How shall we send each other the
notes we write down? In the form of emails?
Alice: The best way would be to use a form of source code control.
The standard package to do this would be CVS, but an even better
alternative would be to use subversion.
Bob: Yeah, I've heard about that approach, from people who use it
when they work with big teams on forever-running projects. But for
the two of us, for a toy project? You accused me of a sledgehammer
approach, but I'm afraid you've just taken up quite a sledgehammer
yourself!
Alice: I bet you will like it, once you get used to it. I started
to use it a few years ago, and now I use it even for things I'm working
on myself, like when I write a lengthy review article, and I want to
make sure I have all the information at hand, from previous revisions
of chapters. But not to worry. It's easy to set up a source code
control system, so I'll do it for us. I'll show you a few commands
you can use to commit changes from your side, and to update your side,
to get the changes I have made. These two commands are the most
important, in fact. We should put everything under this source code
control system: the codes we write, whatever documentation I will add,
and the lab notes we will both keep writing regularly.
Bob: Is this really your last requirement, as you have promised,
before we can start to do some real programming?
Alice: Yes, this is it! We can get started now.
Bob: I thought I never would see the day. Well, as long as you take
care of this code control business -- what did you call it?
Alice: Source code control.
Bob: As long as you take care of it, and it really is as simple as you
said, I'm willing to try it. Anything to get to the point of starting
our programming!