comma operator

Roemer Lievaart roemer at cs.vu.nl
Wed Aug 2 07:20:46 AEST 1989


tada at athena.mit.edu (Michael Zehr) writes:

>If you debate the "harder to read" bit, consider this -- the comma
>essentially is like putting two statements on one line.  would you
>rather read code like:
>  puts("it broke."); exit(2);

>than:
>  puts("it broke.");
>  exit(2);

I often write:

	if (something_goes(wrong) )
		fprintf(stderr, "%s: I give up!\n", argv[0] ) ,
		exit(2) ;

Of course it's no better than using { ; }, but it's not worse either.
____________________________________________________________________________
Roemer B. Lievaart |   Some people are convinced by large gestures, but
Amsterdam, Holland |   get suspicious by arguments.
roemer at cs.vu.nl    | 				-- Nietzsche



More information about the Comp.lang.c mailing list