#### Archived

This topic is now archived and is closed to further replies.

# C++ needs the super-comment

This topic is 5282 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

why, oh why, do we not have something like : //* <- this is a super-comment style /* normal c comment */ code /* c comment */ code /* c comment */ code *// so all the above is invisible so we can Super-Comment lots of code? As things stand, then we have to put lots of little annoying comments into code like above, where we just want to hide the whole thing! Just a rant from //* me *//.

##### Share on other sites
/*// normal C++ commentcode// C++ commentcode// C++ commentcode*/

Anyway, what you really want is not "super-comments", but nested comments. Which could be interesting.

##### Share on other sites
#if 0/* normal c comment */code/* c comment */code/* c comment */code#endif

Like that?

##### Share on other sites
Chozo, thank you! That is awesome. I''m going to use that a lot for development. Only wish I''d thought of it!

##### Share on other sites
quote:
Original post by squirrel_of_death
Chozo, thank you! That is awesome. I''m going to use that a lot for development. Only wish I''d thought of it!

Please don''t. It''s ugly as hell and confusing for anyone maintaining the code (#if 0 is easy to miss and the ide won''t provide any syntax colouring for it).

If you want to remove a block of code from execution, delete it! You can always get it back using your version control system (and if you''re not using one now''s the time to start). free source control for windows or for *nix

##### Share on other sites
The editor I use (Kate) has two little functions built in that will comment and uncomment highlighted text. If the text has some /*...*/ comments it''ll put // before each line. (It also works with non C++ language comments.) Quite handy.

##### Share on other sites
I usually just encase blocks of code in /* */... Or did I miss the point somewhere along the line of this thread?

##### Share on other sites
hey ChaosEngine, that''s why I sneaked the word development in there! read : hacking, you know, when you are tearing the code from file to file in huge chuncks. The gestational experimental stuff you dare not let others see. In hope they think of you as some super-coder.

And RuneLancer, yes, the point is, if you import a huge section of code from someone elses code ( or even your own ), and let''s say it''s full of C style comments. Then let''s say you want the whole lot commented out, just so you can compare it directly with your own. Or browse it, whatever. The problem is.. one /* at the top, and */ at the bottom will not work, as all those little c comments cancel you out. And the motivation for this thread was me getting sick of putting all those little comments, when one is all you are looking for. So enter the Super-Comment!! Yay for the SC. Provided by your friendly pre-compiler!!!

##### Share on other sites
Get a better IDE. Any IDE worth its salt can comment out a region of text.

##### Share on other sites
I''m using MS VC++ 6.0. Looking in my Customize menu->keyboard->macros, I get the CommentOut option. However, that just adds a /* ... */ to whatever you select. Any suggestions?

1. 1
Rutin
45
2. 2
3. 3
4. 4
5. 5
JoeJ
19

• 11
• 13
• 10
• 12
• 10
• ### Forum Statistics

• Total Topics
633002
• Total Posts
3009822
• ### Who's Online (See full list)

There are no registered users currently online

×