Ad space (banner)
๐ŸŸฃJulia Lessons
Lesson 17 / 68

Writing comments

This lesson covers writing comments in Julia, with the aim of making the intent of your code clear to others and to yourself.

A comment is a note for humans that has no effect on execution. # comments one line and #= =# comments several.

The sample code shows all three patterns: a whole-line comment, an explanation added at the end of a line as in price = 100 # product price, and a multi-line comment wrapped in #= =#.

A common early stumble is the multi-line syntax. Unlike the /* */ of many languages, Julia uses its own #= =#, which takes a moment to get used to.

In professional work, comments are also used constantly to disable code temporarily — commenting out.

๐Ÿ“– Reference code
โœ๏ธ Your code
Type your code, then press "Run"

๐Ÿงช This site can't compile or run Julia directly, so it checks on the spot whether what you typed matches the reference code (scoring happens entirely in your browser โ€” nothing is sent anywhere).

Ad space (banner)
Ad space (in-article)