From the course: Learning C#

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Writing C# comments

Writing C# comments - C# Tutorial

From the course: Learning C#

Writing C# comments

- [Narrator] I'm a big believer in commenting code, to make it easier to understand and work on in the future. After you have it looked at it in a while or if someone else is going to be reading your code. The C sharp language provides a few different ways of commenting your code. And we're going to take a moment in this example to see how they work. So here in our folder, for the start in the comments folder, let's open up the program file. So there's a few different ways you can comment your code. Single line comments, are written with two forward slashes at the beginning of the line. And I can write, for example, single line comments start with two slashes, and you can have as many of these as you want. So single line comments are usually good for simple comments throughout a source file. And usually you'll see one, to maybe three or four of these together. If you find yourself writing comments that span more than a few…

Contents