Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
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
   ret
The 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


List of 57 messages in thread
TopicAuthorDate
defensive coding how and why            01/01/70 00:00      
   What do you mean?            01/01/70 00:00      
      Elegant            01/01/70 00:00      
         Paradox?            01/01/70 00:00      
      clarification            01/01/70 00:00      
         Remember            01/01/70 00:00      
            Absolutely, and even then should be avoi            01/01/70 00:00      
            Absolutely, and even then should be avoi            01/01/70 00:00      
            extrodiaray?            01/01/70 00:00      
                extrodiaray?            01/01/70 00:00      
                  Goooooogle            01/01/70 00:00      
                     No, he does not            01/01/70 00:00      
                        proofreading            01/01/70 00:00      
                     Another challeneg            01/01/70 00:00      
                        another challenge            01/01/70 00:00      
               OK, I can not Spell            01/01/70 00:00      
                  this is my point            01/01/70 00:00      
                     I sure you could, But            01/01/70 00:00      
                        Really?            01/01/70 00:00      
                           professors and classes            01/01/70 00:00      
                           Really !            01/01/70 00:00      
                              Hmmm            01/01/70 00:00      
            defensive commenting            01/01/70 00:00      
         Don't know            01/01/70 00:00      
            Ok, let me get away from that word            01/01/70 00:00      
               Gotcha            01/01/70 00:00      
                  and I came to truly despise that word wh            01/01/70 00:00      
                     Just like driving            01/01/70 00:00      
            Elegant equals...            01/01/70 00:00      
               that it            01/01/70 00:00      
               Oh, how true...!            01/01/70 00:00      
                  It's never the author's problem            01/01/70 00:00      
                     I knew a person who told me about a real            01/01/70 00:00      
                        A blissful existence            01/01/70 00:00      
                  Your bugs versus my bugs (or vice versa)            01/01/70 00:00      
                     common wisdom has it that the average pr            01/01/70 00:00      
   One exception            01/01/70 00:00      
      exceptions            01/01/70 00:00      
         vice versa            01/01/70 00:00      
            what is obvious            01/01/70 00:00      
               your mileage may vary            01/01/70 00:00      
                  that is the very same            01/01/70 00:00      
                     competent            01/01/70 00:00      
                        please define "working"            01/01/70 00:00      
                           competent programming => working program            01/01/70 00:00      
   i'm new            01/01/70 00:00      
      if you move your eyeballs a bit to the l            01/01/70 00:00      
         Coding Bible            01/01/70 00:00      
            Precedence vs. explicitness            01/01/70 00:00      
   Outlaw coding!            01/01/70 00:00      
      a program it is, by definition, asynchro            01/01/70 00:00      
         Methinks the point was missed            01/01/70 00:00      
            "Easy?"            01/01/70 00:00      
            but we agree            01/01/70 00:00      
      VIPER?            01/01/70 00:00      
      What does "timing" mean?            01/01/70 00:00      
         excuse the foreigner, if he was not clea            01/01/70 00:00      

Back to Subject List