Commenting+Your+Code

=Commenting= <-- Prev - Contents - Next -->

Commenting allows you to make notes throughout your code. You should comment every block of code to let yourself and anyone else who might be working on the project know what is going on in that block.

You can also comment out portions of code that you think might be causing problems for troubleshooting.

To comment out the rest of a line use // To comment out a large section of code (even spanning multiple lines) use /* at the beginning of the section and */ at the end.

Here is an example of the use of both types of commenting:

The part that is commented out is shown in a different color in order to bring it to your attention.

Commenting something out on accident can also cause problems in your code. code format="csharp" using System; using System.Collections.Generic; using System.Linq; using System.Text;

namespace Add {   class Program {       static void Main(string[] args) {           int numberOne = 0; int numberTwo = 0; //int Added = 0;

/*System.Console.WriteLine("First Number"); numberOne = Int32.Parse(System.Console.ReadLine); System.Console.WriteLine("Second Number"); numberTwo = Int32.Parse(System.Console.ReadLine);

Added = numberOne + numberTwo;

System.Console.WriteLine(numberOne + " + " + numberTwo + " = " + Added); System.Console.ReadLine; */       }    } }

code

<-- Prev - Contents - Next -->