Correct code/unit testing (was Re: Efficient python programmi ng...)

Delaney, Timothy tdelaney at avaya.com
Tue Jun 11 04:33:49 CEST 2002


> From: Peter Hansen [mailto:peter at engcorp.com]
> 
> Perhaps, assuming you put a lot of bugs in the code, some 
> amount of staring will be necessary.
> 
> I believe staring is of little or no use, however, having 
> tried it many times with my and others' code which had bugs and
> not having found those bugs by staring.

Staring in and of itself is not of much use ... however, simply getting
another set of eyes on the code is. I have found that in the majority of
cases, one of two things will occur:

1. The new set of eyes will immediately see the thing you've been failing to
see for the past 2 hours ...

OR

2. While explaining to the new set of eyes enough for them to understand the
problem, *you* will see what you've been failing to see for the past 2 hours
...

Any time I find myself staring at something and making no progress, I get
someone else to look at it. Likewise, I make myself available to others.

Again, this requires egoless programming - it doesn't work if you get upset
when someone else finds your boneheaded mistake; or if you are unwilling to
point out your own boneheaded mistake in front of someone else; or if you
are unwilling to point out someone else's boneheaded mistake because *they*
will get upset.

Tim Delaney





More information about the Python-list mailing list