ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

29- Comments

In Visual Basic, you often encounter the comment symbol (‘) as you read the code. This symbol tells the  compiler to ignore the text following it. Comments are brief explanatory notes added to the code for you to know what the codes tells about.
A brief comment that describes the functionality of the method is a good programming practice. This is for the benefit of the one who examines the code. Comments should  separate the implementation details [how the method does it] that describes the function of the method.
Comments can be put in the same line, or occupy an entire line.

Example:

  1. ' This is a comment that occupy an entire line.
  2. textbox1.Text = "Hello!" ' This is an inline comment.

Use the comment symbol on each line if your comment requires more than one line.

Example

  1. ' This comment is too long and it will not fit on a single line, so we break
  2. ' it into two lines. Other comments use three or more lines.
Facebook Comments

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked *

ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!