[net.unix-wizards] C comments

HOLSTEGE@Cit-20@sri-unix (11/12/82)

Date: 30 Oct 1982 1605-PDT
"in comment" at EOF is spectacularly useful. I once neglected to close a
comment and it ate my entire program without sneezing. As for your other
problem, if comments nested, you could comment out a section of code without
worrying about "subcomments" within. I agree with your sentiments about

    bletch: warning, excessively long comment

Someone suggested that to me and its stupid.

-------

mark (11/12/82)

If you want to comment out a large chunk of code which contains comments, do
	#ifdef notdef
		code to be commented out
	#endif
The idea is that "notdef" will never be defined.  Similarly, when you have
a new way to do something and don't want to throw away the old way yet,
	#ifndef notdef
		new way
	#else
		old way
	#endif
SCCS can be used for the same thing, but if you intend the change to
be quick and the old way taken out as soon as you trust the new way,
this method is handy.

Since #ifdef's nest, this can be used even when the code uses the
preprocessor.