Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-spam!mordor!lll-tis!ptsfa!ihnp4!homxb!mtuxo!mtune!codas!cpsc6a!rtech!wrs!dg From: dg@wrs.UUCP (David Goodenough) Newsgroups: comp.lang.c Subject: Re: Writing readable code Message-ID: <207@wrs.UUCP> Date: Wed, 1-Jul-87 15:08:40 EDT Article-I.D.: wrs.207 Posted: Wed Jul 1 15:08:40 1987 Date-Received: Sat, 4-Jul-87 07:57:07 EDT References: <1158@copper.TEK.COM> <6858@auspyr.UUCP> <17171@cca.CCA.COM> <10509@sri-spam.istc.sri.com> <927@argus.UUCP> Reply-To: dg@wrs.UUCP (David Goodenough) Organization: Wind River Systems, Emeryville, CA Lines: 29 In article <927@argus.UUCP> ken@argus.UUCP (Kenneth Ng) writes: >In article <10509@sri-spam.istc.sri.com>, ehrhart@aai8..istc.sri.com (Tim Ehrhart) writes: >> >2. Needless use of the comma operator and parenthesis to demonstrate >> > manhood to the obliteration of code readability, e.g. >> > if((fd=open("foo",1)<0) >> > [edit] >> > fd = open("foo", 1); >> > if (fd < 0) but what about the line I use (in one form or another) in maybe 40% of the C programs I write: while ((ch = getchar()) != EOF) (think about it!! :-)) and on the subject of readability one thing that would help above _ALL_ others is the use of white space, not just for indenting, but for separating lexical tokens (where appropriate) in expressions: I find the above while statement 1000 times easier to read than: while((ch=getchar())!=EOF) -- dg@wrs.UUCP - David Goodenough +---+ | +-+-+ +-+-+ | +---+