C coding style

utzoo!decvax!harpo!floyd!cmcl2!philabs!sdcsvax!sdccsu3!sdcattb!sdcarl!rusty utzoo!decvax!harpo!floyd!cmcl2!philabs!sdcsvax!sdccsu3!sdcattb!sdcarl!rusty
Tue Oct 26 16:24:20 AEST 1982

Something I've adopted that I think is useful is using a
continue statement when you have an empty for or while
statement. For example

	for (cp = buf; *cp != NULL; cp++)


	while (*cp++ != NULL)

It has the same effect of just an empty statement but
there is something there for your eyes to grab ahold of.

I first saw this used in some of the kernel code in 4bsd;
I assume it was Bill Joy's idea.

More information about the Comp.lang.c mailing list