I do not know what to say, I can understand both positions. In one hand you Dwayne has right that 'obvious' code no need to be commented -- which makes perfect sense. However, I can understand Olin's point as well, where he argues the word 'obvious', which needs a bit of explanation -- obvious to whom? Maybe it is for Andy, but if he leaves the company a graduate developer will have some trouble of maintaining the code. And I believe that's why Olin says you need to comment it 'properly' -- I might wrong of course. Tamas On Mon, Mar 22, 2010 at 4:40 PM, Dwayne Reid wrote: > At 07:11 AM 3/22/2010, Olin Lathrop wrote: >>Dwayne Reid wrote: >> > 2) Andy doesn't comment all of his code. =A0That 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. =A0I call it elegant > code - its extremely short for what it does. =A0I'm pretty sure that I > would not have come up with this version on my own. =A0However, 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. =A0That 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. =A0Sometimes > 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 =A0 > Trinity Electronics Systems Ltd =A0 =A0Edmonton, AB, CANADA > (780) 489-3199 voice =A0 =A0 =A0 =A0 =A0(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 > -- = int main() { char *a,*s,*q; printf(s=3D"int main() { char *a,*s,*q; printf(s=3D%s%s%s, q=3D%s%s%s%s,s,q,q,a=3D%s%s%s%s,q,q,q,a,a,q); }", q=3D"\"",s,q,q,a=3D"\\",q,q,q,a,a,q); } -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist