In numerous lines of coding, it’s really hard to find what a particular part or section of a code does if it is left unmarked. Under these situations, the MQL comments come in handy. It’s helpful to explain a part of the markup language or to disable a particular block of codes from executing while testing and debugging.
These comments act as a temporary control switch to turn ON/OFF a block of codes. They are also very much helpful for documentation as the programmer could easily explain the coding in plain English.
There are 2 types of MQL comments:
- Single Line Comments
- Multi-Line Comments
Single Line MQL Comments
It marks a single line of code as a comment line or to defines what is the purpose of a particular block of code in single line.
// A single line of comment goes here.
Multi-Line MQL Comments
It usually marks or disables multiple lines of code as a comment which helps in testing and debugging.
/* This is a multiple line code. It considers
all the lines until the end as a single line */
Thus these methods of commenting your code will be really helpful for the better understanding of yourselves as well as others who look into your code while it helps you in testing & debugging too.