2007
04.20

Comments in VB and C#









I was just browsing through MSDN website when I noticed something that all this time I considered it very trivial. Apparently in VB, you need to give every line apostrophe (‘) to make that line a comment (I know this). And you can’t use the underscore (_) to continue the comment, you still need to give the apostrophe again in the next line (now that is new).

Very contrast compared to other language such as C# (or other similar language in that matter, like C/C++, Java), you can use double slashes (//) to start a comment. To make multiple-line comment, you need to start it with /* and end it */

The comparison becomes a moot point if you are using Visual Studio. You can easily select the lines, and press Ctrl+K+C to comment it, and Ctrl+K+U to uncomment the selected lines.

Share and Enjoy

  • Facebook
  • Twitter
  • Google
  • Delicious
  • Digg
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

 

Possibly Related Posts

No related posts.

 

Incoming Search Term

how to make coments in vb (2), how to make comments in visual basic (2), collapsible box vb6 (1), how to add multiline comment in VB (1), how to make comment in the vb (1), how to make comment on vb (1), how to make remarks in visual basic? (1)

Advertise Here

4 comments so far

Add Your Comment
  1. I give up with VB, and strict in C#!
    VB, the language I’ve used for 5 years :)

  2. well .. I do like C# a lot, but I must compromise since my most projects are using VB.NET ^^’

  3. hye.
    i know what is the method of assigning single line comment in VB.but wht is the method of assigning Multiline Comments in VB?
    can somebody help.
    kindly reply me on mail.
    bye

* Copy this password:

* Type or paste password here: