Thursday, July 21, 2005

Pattern recognition

Jeff Atwood describes the practice of Just Try Again where coders sometimes re-execute code that fails to see if it "does it again".

I think that one of the benefits of running code multiple times without modification is that it allows us to see patterns. It's a bit like trying to pick out the lyrics in a song: listening to the song once is not enough. In fact, even several times may not be enough to allow you to isolate the different ways the singer has of pronouncing certain words. Depending on which words are grouped with which others the pronounciation may change. This is all very similar to the way that different components in a software system act together to increase the overall complexity of the task of isolating an error.

So when I re-run broken code without changes what I'm really doing is looking for patterns in different parts of the code on each run. Doing so allows me to break down the run into a set of behaviours which I can then analyse to figure out what is out of place.

1 comment:

Jonathan said...

Reminds me of what I read in the great book On Intelligence -- how the brain is all about pattern recognition.