Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!usc!ucsd!ucsdhub!hp-sdd!hplabs!hpl-opus!hpnmdla!hpmwtd!jeffa From: jeffa@hpmwtd.HP.COM (Jeff Aguilera) Newsgroups: comp.lang.c Subject: Re: A question of style Message-ID: <680014@hpmwjaa.HP.COM> Date: 1 Dec 89 22:52:53 GMT References: <1989Nov23.170838.10376@phri.nyu.edu> Organization: HP Microwave Tech. - Santa Rosa, Ca. Lines: 29 >>while (c = getchar(), c != EOF) Too much annoying white space, conveying no information or structure. Try while (c=getchar(), c!=EOF) instead. Pull atomic concepts and actions together. >The standard C idiom for this is > while ( (c = getchar()) != EOF ) Gee. I prefer the first construct. Indeed, it is the only one I dare use, because it is so much clearer. But I understand (and accept) that most programmers are compelled to use the K&R form, following their masters' dogma blindly, criticizing all others. >and experienced C programmers are likely to read the standard idiom >with greater facility than your proposed use of a comma operator for this. I hope an experienced programmer is capable of understanding both expressions. His mental algorithmic model should be independent of the implementation and its expression. ----- jeffa Mathematicians are like Frenchmen: whatever you say to them they translate into their own language, and forthwith it is something entirely different. -- Johann Wolfgang von Goethe