Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!ctrsol!srcsip!jhereg!mark From: mark@jhereg.Minnetech.MN.ORG (Mark H. Colburn) Newsgroups: comp.lang.c Subject: Re: A question of style Message-ID: <427@jhereg.Minnetech.MN.ORG> Date: 1 Dec 89 14:56:17 GMT References: <547@mars.Morgan.COM> <1989Nov30.001947.14883@aqdata.uucp> Reply-To: mark@jhereg.minnetech.mn.org (Mark H. Colburn) Organization: Open Systems Architects, Inc., Mpls, MN Lines: 31 In article <1989Nov30.001947.14883@aqdata.uucp> sullivan@aqdata.uucp (Michael T. Sullivan) writes: >From article <547@mars.Morgan.COM>, by amull@Morgan.COM (Andrew P. Mullhaupt): >> >> ...I can't think of what I would call a 'proper' use of the comma operator... > >while (c = getchar(), c != EOF) >{ > ... >} > >I posted this instead of mailing it to see what, if any, reaction it got. >I'm always interested in coding style. I agree with Henry. There are few "proper" uses of a comma operator. The comma operator, since it is vastly underused tends to confuse most programmer, even competent ones. Besides, there are more intuitive ways to write most code which would require a comma. The code above could be written as while (c = getchar && c != EOF) { ... } Which most programmers would find "more intuitive" than the comma seperated one. -- Mark H. Colburn mark@Minnetech.MN.ORG Open Systems Architects, Inc.