Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: "C's Biggest Mistake" Date: Fri, 13 Apr 2018 08:58:41 -0700 Organization: None to speak of Lines: 25 Message-ID: References: <9c7013a2-17bd-4f94-a378-1c45151d0d45@googlegroups.com> <6zpxC.75432$bz1.69868@fx01.iad> <%6sxC.621528$Ml.294897@fx24.am4> <85txC.105783$q15.11321@fx34.iad> <_MIzC.1013644$Ly1.422539@fx13.am4> <3ef6qe-nvo.ln1@gangtai.grep.be> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="c8c6e38e69bef66bbc77325509afe095"; logging-data="24993"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ELfjku12pZgbiWW71U5Nr" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:YBSGsR14Th99ncwajJHSr/vUvdM= sha1:j064LcndHX//azTwnON43ug/JlA= Xref: csiph.com comp.lang.c:129152 Wouter Verhelst writes: > On 13-04-18 00:19, Keith Thompson wrote: >> Yes, C's comment syntax can cause problems if you're not careful. >> Most proposals to fix those problems would create more problems than >> they'd solve. And changing the language to permit nested comments >> would break existing code, which is unacceptable. > > Moreover, there actually is a way to have nested comments: just encode > the bit you want to comment out in > > #if 0 > #endif > > Those do get nested properly, and will never ever ever get executed (who > said the preprocessor was a bad idea? right). I have a script that wraps a block of code in "#if 0" and "#endif" *and* inserts a "*" at the beginning of each line. That way it's visually obvious that the code has been "commented" out. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"