Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!brutus.cs.uiuc.edu!jarthur!dfoster From: dfoster@jarthur.Claremont.EDU (Derek R. Foster) Newsgroups: comp.lang.c Subject: Re: Nested Comments in C -- A recent experience Message-ID: <5418@jarthur.Claremont.EDU> Date: 25 Mar 90 21:42:37 GMT References: <9631@wpi.wpi.edu> <1990Mar18.045238.18224@utzoo.uucp> Organization: Harvey Mudd College, Claremont, CA 91711 Lines: 35 In article <1990Mar18.045238.18224@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >In article <9631@wpi.wpi.edu> msau@wpi.wpi.edu (Matt Saucier) writes: >>... Although I don't use the nested comment >>method (I use #ifdef DEBUG #endif (or whatever)), I know a lot of people who >>do use them.... > >As has been explained at length, several times, this is a thoroughly bad >idea that programmers eventually learn to avoid. It simply doesn't work ^^^^^^^^^^^^^^^^^^^^^^ >as well as #ifdef. ^^^^^^^^^^^^^^^^^ You forgot to add "IN MY HUMBLE (or maybe not so humble, considering the above statement) OPINION!" I have been using nested comments as debugging tools for many years, and I have NEVER had a problem with them. The only problem I have had is with people like you telling me I SHOULD have problems with them, and telling me I shouldn't use them because YOU think I'll have problems with them. (Which has not happened yet.) I HAVE had problems with #ifdef and #endif -- they're a lot more trouble to use when what I'm debugging is not a completely separate line. Not to mention that I can't have my editor jump to matching #ifdef and #endif pairs, regardless of nesting, like I can with /* and */ (I just position the cursor, press ctrl-q-[, and it finds the matching /* or */) All in all, when I hear you telling me "it simply doesn't work as well", and I consider my own experiences with the above facts, my first inclination is to laugh in your face. I have saved myself a TREMENDOUS amount of time by not using #ifdef and #endif when I don't think they are necessary. You may think nested comments aren't worth the trouble, but that's just YOUR OPINION. Say "_I_ haven't found it as easy to use, and _I_ think #ifdef and #endif are bettter" Other people may have had different experiences. >MSDOS, abbrev: Maybe SomeDay | Henry Spencer at U of Toronto Zoology >an Operating System. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu Derek Riippa Foster