Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!uwmcsd1!bbn!bbn.com!mesard From: mesard@bbn.com (Wayne Mesard) Newsgroups: comp.lang.c Subject: Re: Unnecessary parenthesis Message-ID: <26700@bbn.COM> Date: 7 Jul 88 22:12:27 GMT References: <2550075@hpisod2.HP.COM> Sender: news@bbn.COM Lines: 41 From article <2550075@hpisod2.HP.COM>, by decot@hpisod2.HP.COM (Dave Decot): >> > return 0; /* intuitive */ >> >> To a FORTRAN programmer. > > And to a C programmer. Return is a statement that modifies the default > flow of control, such as: > > goto label; /* NOT goto(label); */ > break; /* NOT break(); */ > continue; /* NOT continue(); */ > Great. I thought the idea of HLL's was to spare the programmer the burden of thinking like s/he was inside the machine. return takes an *expression*. Are there any other statements in the language which have unparenthesized *expressions* in their form? That lil old zero hanging out there by itself LOOKS INCONSISTENT. From the compiler's point of view return is in the set of {goto, break, continue} but this seems an unnatural and confusing view for a programmer to hold in his head. >> 1) Because it looks consistent. > > With what? With the rest of the language (see above). > Why do you want to make it easier to confuse function calls > with statements that don't come back? > Glad you asked. Because it's consistent with the two other statements commonly used to change the flow of control in the middle of a function: exit() and execl(). -- unsigned *Wayne_Mesard(); MESARD@BBN.COM BBN Labs, Cambridge, MA "I am catatonic. And the drinks are on the house." -DB