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