Path: utzoo!attcan!uunet!samsung!usc!ucsd!pacbell.com!ames!ads.com!sparkyfs!mckenney From: mckenney@sparkyfs.istc.sri.com (Paul Mckenney) Newsgroups: comp.lang.c++ Subject: Re: // and phases of translation Message-ID: <32392@sparkyfs.istc.sri.com> Date: 4 Jul 90 19:19:10 GMT References: <1580@io.UUCP> <804@mwtech.UUCP> <32374@sparkyfs.istc.sri.com> <278@taumet.com> Reply-To: mckenney@itstd.sri.com (Paul E. McKenney) Organization: SRI International, Menlo Park, CA 94025 Lines: 30 In article <278@taumet.com> steve@taumet.UUCP (Stephen Clamage) writes: >I am mystified by the continuing arguments in this thread. The semantics >of allowing //-comments to go to the end of the line except when they >don't go to the end of the line seem pretty strange to me. C++ does >still have /*...*/ comments, please recall, and this comment form does >precisely what is wanted without requiring odd semantic interpretations. >So if you must use complex macros in C++, and if you must have internal >comments in them, just use /*...*/ comments. This always has worked >and always will work. //-comments are currently defined (Ellis & Stroustrup) to go to the end of the line, except when they go past the end of the line. This seems quite strange to me. In constrast, having the effect of a //-comment end just before the first subsequent newline or escaped newline seems quite simple and natural. It preserves a major advantage of the //-comment -- the end of the comment is immediately obvious; the human reader need never painfully scrutinize the code to find out where the comment ends. Of course, I -could- use /*...*/ comments exclusively. I do use them for large boxed comments, mostly because I have templates for these from years of C programming. I also use them inside of the occasional large, complex macro, since I have no real choice (I refuse to leave such macros uncommented!!!). However, I much prefer the //-comments, and am very happy that they are in the language. I just wish that they were better integrated. >I dunno. Maybe I'm too simple-minded. Or maybe I am expecting too much gratuitous consistency and ease of use. Thanx, Paul