Commenting your code


show more Commenting your code provides you with in-depth training on Developer. Taught by Walt Ritscher as part of the Visual Studio 2010 Essential Training show less
please wait ...

Commenting your code

There are two kinds of documentation that are frequently written by developers. First, we have code comments, and second, we have help files. In this movie, I'll cover code comments, which explain the purpose of the current code and help make the code self-documenting. I am inside Visual Studio, and I have opened a solution called Comments, which contains two projects: a C# project and a Visual Basic project. I am going to spend the majority of my time commenting code in the C# project, but nearly everything I show you works exactly the same in Visual Basic, WPF, Silverlight, HTML--you name it.

Let's start by open this Book class. Here I have got a single-line comment. C# comments are started by using two slashes. I can also do multi-line comments. Let me open the Program.cs file. This is what a multi-line comment looks like. You start by putting the slash and the asterisks, and then you end the multi-line comment by using an asterisk and a slash. That comments out all the code between ...

Commenting your code
Video duration: 2m 45s 8h 9m Intermediate

Viewers:

Commenting your code provides you with in-depth training on Developer. Taught by Walt Ritscher as part of the Visual Studio 2010 Essential Training

please wait ...