Writing comments
Although the writing of comments does not fulfill a specific function during our programs' execution, they are essential for good documentation of the written code and explicitly exposing a particular code segment's intention.
Bosque provides two types of comments that we can use interchangeably:
- Line comments, declared by the characters
//
at the beginning of a line - Comment blocks, which will be framed between the characters
/*
at the beginning of the block and*/
at the end
In the following code, we can see how to write each type of comment:
// This is an inline comment /* This is a multiline comment */
As we can infer, comments will not be included in the final build, so we should write as many as we consider necessary to allow a better understanding of the code.
Next, we will see how Bosque implements variables, which are a widely used concept in most algorithms.