Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!mcnc!rti!mozart!sherman From: sherman@unx.sas.com (Chris Sherman) Newsgroups: comp.lang.c Subject: Re: Dealing with pointer freaks Message-ID: Date: 25 Jun 91 10:02:31 GMT References: <6470@goanna.cs.rmit.oz.au> <2075@manta.NOSC.MIL> Sender: news@unx.sas.com (Noter of Newsworthy Events) Distribution: comp Organization: SAS Institute Inc. Lines: 45 Nntp-Posting-Host: foster.unx.sas.com In <2075@manta.NOSC.MIL> grantk@manta.NOSC.MIL (Kelly J. Grant) writes: >In article <6470@goanna.cs.rmit.oz.au>, ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes: >> In article , mikeg@c3.c3.lanl.gov (M. P. Gerlek (hack grad student)) writes: >> > I have this officemate ... who considers himself a competent C programmer, >> > but insists on writing what most of us consider very bad code. >> >> Be clear about what you mean by "bad". >> > No kidding, he writes ... *(x+i) ... [instead of] ... x[i] ... Real C Programmers (TM) aren't bothered by *(x+i). On the other hand, C Programs who used to be Pascal (or whatever) programmers are. :-) Actually, I don't have a problem with *(x+i) because when the code gets ugly, I can decompose the pointer line into something that looks like *(x+i), and be able to understand it more. >Code written in a shop *should* conform more or less to a certain style >(whatever the style may be). This is especially true for a project >where one person is working alone. In this situation, if the person >doing the project can't finish for some reason, then someone else is >going to have to come in and pick up the ball. If the person's code is >written in an "unintelligible" style, then more money will be lost by >the second person either having to waste time trying to read the code, >or having to rewrite it. This is always true. The grey area between personal style and group style is a religious issue which will last longer than any of us. IMHO, leave the dude alone. Jump up and down when you find major problems in his code like: char *d="068B9669996E9EA9E999E9DB999ACA9F8C8F",*p="12342506775730",o[480],*r,*q, c,*z,*e,x,l=80,y='0';s(){memset(o,' ',480);z=o;}main(){s();while(c= *p++)if(c-=y ){for(r=z+320,e=d+c*5;r>=z;r-=l,e--)for(x=(*e-y&~15)?*e-'A'+10:*e-y,q=r+4;x;x>>= 1,q--)if(x&1)*q='*';z+=6;}else{for(r=o;r