-
Comments
Comments in programming are like notes that you can write down to help you remember things. It's like if you were doing a puzzle and wanted to remind yourself which piece goes where, then you would write it down on a piece of paper. Comments in programming are like that, except they go inside the code instead of on a separate piece of paper. They make sure that when someone else looks at your code, they know what each part does.
-
-
Single Line Comments
-
A single line comment is a non-executable string that hold one line of text (a word, phrase, sentence, or code).
Javascript
Example of single line comment in javascript.
// This is a single line comment
void main() {
 // This is a single line comment
}

void main()
{
	// This is a single line comment
}

<?php
// This is a single line comment
# This is a single line comment
package main

func main() {
	// This is a single line comment
}

-
-
-
Multiline Comments
-
A multiline line comment is a group of non-executable strings that hold one or more lines of text (phrases, sentences, or code).
Javascript
Example of multiline comment in javascript.
/*
This is a multiline comment

that can span many lines
*/
void main() {
 /*
 This is a multiline comment

 that can span many lines
 */
}

void main()
{
	/*
	This is a multiline comment

	that can span many lines
	*/
}

<?php
/*
This is a multiline comment

that can span many lines
*/
"""
This is a multiline comment

that can span many lines
"""
package main

func main() {
	/*
	 This is a multiline comment

	 that can span many lines
	*/
}

-
-