At 07:11 AM 3/22/2010, Olin Lathrop wrote: >Dwayne Reid wrote: > > 2) Andy doesn't comment all of his code. That doesn't mean that its > > bad code. > >I can't speak for other code Andy has written that I haven't seen, but I >stand by my assesment that this particular piece is bad code. I guess that we'll have to disagree on this one. I call it elegant code - its extremely short for what it does. I'm pretty sure that I would not have come up with this version on my own. However, I had no problem following what he does and verifying that it appears to do what he says. If you treat what Andy has posted as a 'canned' routine, it is completely documented. That is: he tells you how to allocate the registers (and that their order is important) and he describes what the routine does with various input examples. I've seen other examples of Andy's code - he tends to put his comments as a block at the beginning of each routine. Sometimes those comments are extremely verbose - he takes the time to point out WHY he did something if its important. In this case, I'd guess that he considers the code 'obvious' and provided the minimum documentation required to be able to use the block in your own software. dwayne -- Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax www.trinity-electronics.com Custom Electronics Design and Manufacturing -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist