1

Something that has always burned me up in programming, not just VB, is how inefficient it is to make multi-line comments. I'm not exactly a neat freak, but I do like comments to all be about the same length, around 80 characters including leading whitespace. But, to do this, I have to manually control how long the comments are. And the really frustrating part is when the change to only a few words requires an unreasonable amount of work.

I have found many questions on StackOverflow asking about multi-line commenting, but none to actually address this feature.

Wouldn't it make sense to have a commenting feature in VB, Eclipse, etc. to enter a a mini word processing mode mode that would low simple features like word wrap that would format the comment automatically? Is there one available that I'm just missing?

Or am I just being lazy? But, if it is a good idea, how can it be suggested to Microsoft, Eclipse.org, and others.

enter image description here

Tom K
  • 321
  • 1
  • 4
  • 15
  • Can you show an example of what you mean? – OneFineDay Jul 16 '15 at 14:01
  • I think I read the next Visual Studio version will support multi-line comments. – rheitzman Jul 16 '15 at 14:05
  • Some editors have do commands to format multi-line comments. For example, in Vim I can type `gqap` and it will reformat a multi-line comment to 80 character lines by default. There may be plugins for Visual Studio to achieve this; [In Visual Studio, is there a way to word-wrap ONLY comments?](http://stackoverflow.com/questions/2524884/in-visual-studio-is-there-a-way-to-word-wrap-only-comments) might be helpful. If you use a different text editor, check whether it has a comment formatting feature available. – Lithis Jul 16 '15 at 14:11
  • I don't get how this is a problem. When typing hit the `Enter` button then `'` and continue typing... – OneFineDay Jul 16 '15 at 14:20
  • Most of the time it isn't. But, if a comment takes up multiple lines and you go back and make even minor changes, it can mess up the formatting. For some people, that may not be a big deal. I like to have everything about the same length. – Tom K Jul 16 '15 at 14:21
  • 2
    I agree that this would be a nice feature. I'm not sure that StackOverflow is the place for IDE feature requests though. – Blackwood Jul 16 '15 at 14:43
  • Blackwood, as someone who is trying to get into the industry, I have ideas that are new for me, but not necessarily new to the community. Part of what I'm asking is if it was already implemented by someone. – Tom K Jul 16 '15 at 15:02
  • Perhaps write your own external tool to do this? Copy the existing comments (if any) to the clipboard, launch the tool via the Tools menu, then paste the results over the highlighted comments. – rheitzman Jul 16 '15 at 15:56
  • Maybe at some point, but I'm trying to not reinvent the wheel. :-) – Tom K Jul 16 '15 at 18:20

1 Answers1

2

The only way to do multi-line comments in VB.NET is to do a lot of single line comments.

Really, the only option you have is the single tick (') in front of a line.

You can use Ctrl+K, Ctrl+C and Ctrl+K, Ctrl+U to comment or uncomment selected lines of text. In C# you can use /* ... */ to comment an entire block of code. Look for more information on Custom Writing

Amy
  • 21
  • 1