Thursday, May 01, 2008

The code review I got from Grant last weekend was really great, but I'm back to programming solo. Luckily, one of the nice things about code reviews is that when you explain something, you are likely to see problems with it before the person you're explaining to even finishes parsing your tech-tech-tech. And you don't even need the other person to make this work if you're disciplined enough to read code aloud all by your lonesome. (I can read code to the cat at home, but maybe I need a teddy bear at work.)

So here's how I read some code to myself yesterday:


Okay, first step here is we get a list of graphs to draw, it's a generator.
We go through each graph figuring out which datafiles we need to load so we
only load them once.

This we know is working so far because of print statements, showing two
datafiles in this case.

Now the next step, we're going through the generator again,... oh.


Yeah, you can't use a generator twice in Python and I knew it, but I didn't remember it until I heard myself speaking out loud. What's up with that?

1 comment:

Alan H said...

Ah yes. You've rediscovered the stuffed code monkey. We had a baboon at our graphics lab in University that you could explain your code problem to. He never said much but it was amazing what you could solve by talking 'with' him.

Blog Archive

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.