views:

267

answers:

4

I read that great post on Visual Studio 2008 annoyances, but didn't see this one. It drives me crazy. Now, I realize that some people use block comments like this for function documentation and the like:

/*
 *
 *
 *
 */

But you know, this is VS2008 and now we can use ///. The only time I ever feel the need to use C-style commenting is when I have some junk or test code that I temporarily want to remove. It absolutely drives me nuts when I do the first /* and then when I add a line after the test code, it automatically puts a space after the * and I end up with this: * / . So then I end up always having to backspace to complete the block comment.

I looked through all of the C# editor settings in the VS2008 IDE, and didn't find anything relevant.

Does this drive anyone else here crazy, or am I turning into a codemudgeon?

A: 

That behavior can be turned off, but it will also turn off the automatic creation of XML comments after typing ///.

To turn it off, open the options dialog and go to Text Editor/C#/Advanced. Uncheck "Generate XML documentation comments for ///".

Chris R. Timmons
thanks... unfortunately, that won't work for me because I also use /// a lot.
Dave
+4  A: 

Without losing XML comments functionality, you can use #if to exclude code frahments, for example:

#if EXCLUDED
any code ...
#endif

In C++ use #if 0.

Alex Farber
yes, this might be my only resort.
Dave
+6  A: 

I just avoid the block comments and instead I select the block and hit ctrl-k-c which will automatically comment out a whole block with // on each line. To undo it select the block and hit ctrl-k-u to uncomment the block. It doesn't fix the extra space issue, but it lets you not care.

Mike Two
yeah i do that too, but on my system it is ctrl-e,c anf ctrl-e,u for some reason. :)
Dave
@Dave - Actually I normally use Resharper's version of it, but sometimes I don't have Resharper and revert. Wonder why it's ctrl-k for me.
Mike Two
A: 

I also agree with Dave. The auto addition of the star on the next comment-block line makes me sad to the point of really disliking Microsoft for imposing their affective and unnecessary formatting standards on the developping community. Quite honestly, I even find it quite contradictory to most past Microsoft implementations which usually empower the user instead of locking him down in a dark and humid cell. Hahhh! The good old times when Bill was king!

Daniel
I would have been fine with it all if they just didn't add the space next to the asterisk. ;)
Dave