home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / cplus / 15829 < prev    next >
Encoding:
Text File  |  1992-11-05  |  1.4 KB  |  30 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!secapl!Cookie!frank
  3. From: frank@Cookie.secapl.com (Frank Adams)
  4. Subject: Re: Help! I don't know the language yet!
  5. Message-ID: <1992Nov05.171017.67773@Cookie.secapl.com>
  6. Date: Thu, 05 Nov 1992 17:10:17 GMT
  7. References: <1992Oct29.172531.20969@doug.cae.wisc.edu> <1992Nov03.185818.12629@microsoft.com> <1992Nov4.194123.21282@netcom.com>
  8. Organization: Security APL, Inc.
  9. Lines: 19
  10.  
  11. In article <1992Nov4.194123.21282@netcom.com> ort@netcom.com (David Oertel) writes:
  12. >>Common wisdom is to use #ifdef/#endif for commenting out code.
  13. >
  14. >    Because /**/ cannot ( usually) be nested.  An embedded /**/ may
  15. >    cause a premature termination of the comment.
  16.  
  17. I prefer to use // for commenting out code.  This works whether the code has
  18. /* */ comments or // comments.  It has the advantage over both other
  19. approaches that you can see at a glance what code is commented out.
  20.  
  21. Of course, you need editor support to comment out any large block of code.
  22. I have two macros defined for my favorite editor (Brief) which do this.
  23. One takes a selected block, and inserts a specified string at the beginning
  24. of each line of the block.  The other takes a selected rectangular block,
  25. and deletes everything in it, moving the remainder of the line back.  (The
  26. latter comes with the editor; the former I wrote myself.)
  27.  
  28. These are both generally useful macros; neither is used solely for this
  29. purpose.
  30.