How to add comments to your code?


Comments Vertex Academy

Very often it’s necessary to add some comment while writing a program.

For example:

  • This block code is responsible for…
  • This variable is responsible for…
  • etc.

Believe me, it’s a very good practice to add comments. As a result:

  • It will always be easy for you to remember what is what in your program. It’s a common situation when you don’t touch the code for the whole month, then you open it and you do not believe that it was you who wrote it. And at this point your heart is high because you see the comments…
  • And those, who will work with your code after you, will say “thank's a lot”. Probably you won’t be close at hand to answer a question of your college: “Dude, what did you have in mind writing this?”

That’s why you should add comments – take care of yourself and future generations.

So how do you add a comment? Let’s look at the example below:

Example No.1

 The example shows, that if a comment is written in one line, then we use two slashes // and then write our comment.

If we wrote the comment in two or more lines, then we need to use this construction for comments writing:

Well, now you know how to add comments in the code. Mission of our article is accomplished. In the end I want to share with you this Latin saying, that is suitable to comments as well:

Save the order and it will save you





Publiction author

offline 4 hours

Vertex Academy

Comments: 0Publics: 274Registration: 06-03-2016

Leave a Reply

Your email address will not be published.

Subscribe news

Subscribe to our newsletter we will keep you up-to-date!

Самоучители--узнать детальнее--