Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags


How to use comments in Euphoria



Euphoria is a programming language that is fast and easy-to-understand. It allows us to learn syntaxes and particular ways of doing things. One of these particular ways is writing comments.

A comment in any programming language is a simple explanatory note that is added in the program and that the computer system does not execute while the program is running.

The usefulness of inline comments in a program cannot be overemphasized. The documentation of a program is said to start from the inline comments. It also encourages collaboration and eases the workload that is associated with debugging.

How can we write comments in Euphoria?

In Euphoria, programming comments are written in the three of the following methods:

1. Using a special symbol (#!)

These types of comments can only be written at the beginning of the program and start with the #! symbol.

For example:

#! enter comments here

2. Using the double dash (--) character

This is another way of writing comments in Euphoria, where the comments are written inside a double dash pair, like this:

-- enter comments here --

-- can be used anywhere in the program code and supports single line commenting only.

3. The multi-line comments

The comment styles discussed so far are only for single-line comments. When we wish to have a comment that will run into several lines, we must use the multi-line comment style. In this style, we start the comment with the slash and asterisk characters (/*) and end it with an asterisk and slash character (*/).

For example:

/* This is a 
  multi line comment

Some comment tips

  • Write concise comments.
  • If fewer comments are required, make sure they are written in simple language and are to the point.
  • The start and end of every code block that does a specific action should be indicated with comments.



View all Courses

Keep Exploring