Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!ctrsol!uakari!ark1!dpaulso From: dpaulso@ark1.nswc.navy.mil (Dave Paulson) Newsgroups: comp.lang.c Subject: Re: use of if (!cptr) and if (cptr), where cptr is a * Message-ID: <37@ark1.nswc.navy.mil> Date: 21 Jul 89 21:34:53 GMT References: <10099@mpx2.mpx.com> <93@microsoft.UUCP> <10100@mpx2.mpx.com> <10103@mpx2.mpx.com> <14580@dartvax.Dartmouth.EDU> Reply-To: dpaulso@ark1.nswc.navy.mil Organization: Naval Surface Warfare Center, Dahlgren, VA Lines: 19 In article <14580@dartvax.Dartmouth.EDU> ari@eleazar.dartmouth.edu (Ari Halberstadt) writes: >[...] > >One place I've found the comma operator to be very useful is when an error >must be handled and an error code returned from a function: > if (error) > return(perror("it failed"), FALSE); >This saves the nuisance of using braces and two statements. I don't usually like to complain about other people's coding preferences, but this just struck a nerve. This is just plain ugly. When *I* see a comma operator, I tend to think of two things being done in parallel, so the impression I get when reading this segment is different from what is really going on. Besides, what's so doggone hard about adding a couple extra braces and semi-colons? Oh well, back to my cage.