Positron Compiler Documentation

Using Include files to tidy up your code

Positron16 · Revision 1.1.3.5 · PDF page 446

There are some considerations that should be taken into account when writing code for an include file, these are: -

1). Variable and Label names should be as meaningful as possible.

For example. Instead of naming a variable MyLoop, change it to Isub_Loop. This will help eliminate any possible duplication errors, caused by the main program trying to use the same variable or label name. However, try not to make them too obscure as your code will be harder to read and understand, it might make sense at the time of writing, but come back to it after a few weeks and it will be meaningless.

2). Comment, Comment, and Comment some more.

This cannot be emphasised enough. Always place a plethora of remarks and comments. The purpose of the procedure/s within the include file should be clearly explained at the top of the program, also, add comments after virtually every command line, and clearly explain the purpose of all variables and constants used. This will allow the procedure to be used many weeks or months after its conception. A rule of thumb that I use is that I can understand what is going on within the code by reading only the comments to the right of the command lines.

View original PDF page 446Open page in PDFOriginal PDF page 446