Skip to content

Comments

Harneet implements C-style comments, the best commenting system ever to be used by humankind. Comments are used to add explanatory notes to your code. They are ignored by the interpreter.

There are two types of comments:

Line Comments

Line comments start with //. Everything from // to the end of the line is a comment.

Line Comments
1
2
3
// This is a line comment
package main
var x = 42 // This is also a line comment

Block Comments

Block comments start with /* and end with */. They can span multiple lines.

Block Comments
1
2
3
4
5
6
/*
This is a block comment.
It can span multiple lines.
*/
package main
var y = 10