From: utzoo!decvax!ucbvax!CAD:teklabs!zehntel!sytek!menlo70!hao!hplabs!sri-unix!news Newsgroups: net.unix-wizards Title: My Two Cents On Nested Comments Article-I.D.: sri-unix.4521 Posted: Tue Nov 30 22:24:52 1982 Received: Sat Dec 4 09:27:53 1982 Date: Monday, 29 Nov 1982 14:27-PST I have to laugh when I see some of the examples that illustrate the "merits" of nested comments in C. I can't believe they're legible (for blocking out code) to anyone except the person who wrote them. And I've seen plenty of programs where someone cleverly nested comments, and accidentally cut out part of the code he wanted to include. Better solutions are: 1) Use SCCS or RCS, or a similar system. RCS is public domain, so don't say you can't afford it! 2) Presumably you're blocking out code because it's debugging information, or machine-dependent, or the like. In that case, use an #ifdef. Even if you're just cutting out the line to test the effect on the program during development, you'll save yourself time by not trying to be tricky with comments. Yes, comments are more general (you can block off a "+ 1" in the middle of a line), but they are also more error-prone, and besides, in any good C programming style, code is spread over enough lines so that this seldom matters. Personally, I'm tired of seeing the message "syntax error" and having to trace that to an unclosed comment. I'd much rather have the compiler flag nested comments as errors. -- Steve