Comments
A comment is a special string, which is processed differently from other code elements, as it is ignored by the parser and has no effect on the behaviour of a program. Comments are therefore best suited for describing code functionality and informing the reader of important info.
Syntax
- Single Line Comment:
- Block Comment:
Function Comments
Function comments are special comments, which are placed directly above a function definition. They are used to describe the functionality of a function and its parameters, and should be used whenever a function is not self-explanatory.
Function comments are written in the following format:
This is a best-practise for any large code and library, as it allows the user to quickly understand the functionality of a function, without having to read the entire function body. Especially also using IDEs this is essential for quick and easy development.