typedefs, etc. - (nf)

Spencer W. Thomas thomas at utah-gr.UUCP
Fri Jan 6 00:42:18 AEST 1984


Not to beat on an old subject too much (and, please, let's not start yet
another discussion on this matter), but the parentheses on the return
statement have not been required since Unix V6.  So, howcome everybody
keeps using them?  Is this just another example of "programmer
superstition?".  What gives?

The question "why use the style `return( a == b );'?" was raised.  Well,
I think that this is in analogy to a function call, where the
parentheses are part of the function call syntax, not the arguments.  E.g.,
I would write `f( a )' in preference to `f (a)'.  Now, in the return
statement, the parentheses are NOT a part of the syntax, so if you are
going to use them, you should probably write `return (a == b);' to remain
consistent.  But, `return a == b;' will do just as well.

=Spencer "I always remove parens from returns"



More information about the Comp.unix mailing list