parens around sizeof arg

Kevin Szabo ksbszabo at wateng.UUCP
Sun Feb 10 13:58:11 AEST 1985


In article <8048 at brl-tgr.ARPA> cottrell at nbs-vms.ARPA writes:
>	if (exp)			if (exp) {
>		return exp;			exp;
>						return;
>					}
>
>The example on the left avoids the braces while semi-documenting
>the fact that. I know, you are shocked! I'm just a bad guy.

Sir, you are a sinner. I hope I never have to look at your code. ( 1/2 :-) )
The code on the left tells me that you are trying to pass back
a value to the calling routine, and I would be confused as to why
the calling routine chose to ignore it. If you insert a comment
to document the fact you are doing something odd, why not just do
it right the first time and avoid the comment? Of course you may
not put in any comments, but I amazed that you can figure out what
your code does three months after you wrote it. 

You really should be coding in B, or assembler.

					Kevin
-- 
Kevin Szabo  watmath!wateng!ksbszabo (U of Waterloo VLSI Group, Waterloo Ont.)



More information about the Comp.lang.c mailing list