01Hello, world
Comments
Notes for people that the computer skips.
A comment is a note for people who read the program. The computer skips it. Zaka has three markers that start a comment. Each runs to the end of its line.
စံကား
Expected output
၃
၆
The program makes a number called အရေအတွက် (count), prints it, and prints it doubled.
The Variables chapter explains how that works. For now, look at
the comments: none of them change what the program prints.
| Zaka | Reads as | Job |
|---|---|---|
// | — | comment to the end of the line |
/// | — | same; as a rule, describes the code below it |
မှတ်ချက် | "note" | same, in Burmese |
Zaka has no comment that spans several lines. Start each line with its own marker.
မှတ်ချက် must stand alone
မှတ်ချက် starts a comment just when it is a word on its own, with a space after it.
Joined to the next word, it is read as program text:
စံကားZK0202
Expected error
error[ZK0202]: expected an operand, found "မှတ်ချက်"
Hands on
- Add a comment above each line of the Hello, world program that tells what the line does.
- Switch off the last line of the example above with
//. What prints now?
Next: Printing.