Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!uakari!aplcen!boingo.med.jhu.edu!welch.jhu.edu!ted From: ted@welch.jhu.edu (Ted Ying) Newsgroups: comp.lang.c Subject: Re: Re^2: Why nested comments not allowed? Message-ID: <1990Feb23.150441.455@welch.jhu.edu> Date: 23 Feb 90 15:04:41 GMT References: <236100027@prism> <7330017@hpcllak.HP.COM> <1990Feb19.143619.17663@uncecs.edu> <1975.25e0048c@wums.wustl.edu> <1990Feb20.165353.14212@uncecs.edu> Reply-To: ted@welchlab.welch.jhu.edu (Ted Ying) Organization: Welch Medical Library, Baltimore Lines: 29 In article <1990Feb20.165353.14212@uncecs.edu> utoddl@uncecs.edu (Todd M. Lewis) writes: > >You have quite precisely missed my point. It was even in quotes. Briefly: > 1) "comment out a section..." Use comments. > 2) "compile if x {not} defined" Use #if{n}def/#endif. >See the difference? In particular, I did not say that nested comments are >the better way to suppress the compilation of a section of code. If it's a >comment it isn't code! The notion of conditionally compiling comments is >a bit off the mark, IMHO. Comments are never compiled--nothing conditional >about that. Lexed or parsed maybe, but not compiled. > OK, Todd. I understand the difference that you are pointing out. The point you seem to be making is that comments should be restricted to non-code. However, in that case, you are usually entering text or pseudo-code or something description or important to the section of code. In that case, why would you ever want nested comments? I think that nested comments are needed only if you would like to be able to "comment" out a section of code that might have comments in it otherwise. If that is the case, then it is more appropriate to use #ifdef/#endif. I'm not saying that nested comments are useless, just that they are not necessary especially when compared with the cost for generating a nested comment parser. Ted Ying ted@welch.jhu.edu #include Approximating the Taylor series: Mike Todd + Eddie Fisher + Richard Burton + John Warner + ...