Code Comment

86c043eaa94314399cc064d153a93d26
0
_NOISEcore 101 Oct 06, 2011 at 14:57

This may sound like a really dumb question. But I can’t seem to find it anywhere on the internet.

Say that you are coding in Visual Studio, sometimes when you select a method, and InteliSense pops up, you can see which parameters are needed in a yellow-ish box.

Sometimes though, there is a text commenting the method in this same box.
How do you write these comments?

I’m writing some generic library for some friends of mine (for easy use) and
I would like to comment my code decently. It would be nice if they could see this comment by just hovering over it in InteliSense :)

7 Replies

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Oct 06, 2011 at 16:12

It just extracts it from the header file where the method is defined; if there’s a comment above the method, or on the same line as the method, it’ll (hopefully) pick that up.

8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Oct 07, 2011 at 11:57

Depends on your version of VS (Esp. Express vs not) and language.

For c#, it’s old, but a good start.

For C++, it’s a bit harder.

86c043eaa94314399cc064d153a93d26
0
_NOISEcore 101 Oct 07, 2011 at 22:48

Wauw. I had never seen the xml documentation before. This is really handy !
Thanks !

86c043eaa94314399cc064d153a93d26
0
_NOISEcore 101 Oct 08, 2011 at 20:23

Anyone has any recomendations for which program to use to transform the XML file into useful help/docu file?

6837d514b487de395be51432d9cdd078
0
TheNut 179 Oct 09, 2011 at 11:46

Doxygen is one of the best ones out there. It supports many forms of commenting formats and programming languages. If you install graphviz in addition to Doxygen, you can produce class relationship diagrams. By default Doxygen will write HTML files, but you can export to RTF or my personal fav, CHM (compiled HTML).

86c043eaa94314399cc064d153a93d26
0
_NOISEcore 101 Oct 09, 2011 at 14:47

Doxygen did the trick. Thanks alot !

3480c929041b6e58213aee4975c93332
0
Serapth 101 Nov 29, 2011 at 18:39

Frankly this can be acheived as easily as a triple slash ( /// ) which will automatically expand to the format required, then you just fill in the blanks.