??? 08/16/05 09:27 Read: times |
#99497 - proofreading Responding to: ???'s previous message |
This all is more about psychology than anything else so speaking from (here: my) personal experience is not a valid and universal method, that's true; and I don't have time nor money to conduct a proper research. But let me be subjective.
The proofreader - as all men - is lazy. If he has a short path available (the easily readable comment) he will take it. We need to push him somehow to THINK. The best way to achieve this is to give him as little opportunities to take the short path as possible. An example: ;***************************************************************** ;The following routine shifts a longint in r4:r5:r6:r7 right ; by a number of bits given in A. ;A is first moved to R2, then it loops R2 times ; and in each loop makes one shift ;Destroys R2 ;***************************************************************** ShiftLong: mov r2,a Loop: mov a,r4 rrc a mov r4,a mov a,r5 rrc a mov r5,a mov a,r6 rrc a mov r6,a mov a,r7 rrc a mov r7,a djnz r2,Loop retThe lazy proofreader reads the comment (acknowledges that it describes what resources it uses - checks by eyes, yes, indeed, uses r2), then he just runs his eyes QUICKLY through the routine itself - nothing special, moves the 4 registers around and uses rrc for the shift itself. He does not need to THINK: "what-the-hell-is-it-supposed-to-do???". So he misses the error (which in fact might or might not be an error, depending on the context - but that's what the proofreader has to find out, too - or at least note the original author, that it is ambiguous). I think there is almost never a need to proofread an isolated routine, it is always part of a - supposedly functional - program. And the proofreader knows the function of the program, the surrounding hardware; the program uses (hopefully) legible names for variables and for routines "names" (here:labels) - so he has enough clues to figure out the details fairly quickly, while he is still pushed to THINK all the time. Btw. when using a HLL it is even easier as those tend to be self-documenting - except if it's http://www.ioccc.org/1985/august.c and alike (although check out also http://www.ioccc.org/2000/primenum.c on the same page; well this IS the real obfuscation!) Jan Waclawek |