Using comments to create code graph

February 19, 2020 by Igor Lozhkin
"Just do it" is one way to start writing code. But there is an alternative - use comments to create blocks which would later be filled with code.

With Arnica WebScript, comments could be used not only to annotate code, but also to build a blueprint for future code. Developer would create the high level structure using comments, concentrating on major logic components, and only then start coding for each atomic section in the code.

In Arnica script, comment blocks start with *#. Comments placed just above IF statement appear in the IF condition of the code graph, same as comments appearing just above DO WHILE. FOR LOOP, TRY statements would describe corresponding program flow section.

For example, the following is code blueprint which consists of only comment blocks and IF statements, controlling the code flow logic:

comment_blocks_in_script.png

Corresponding code graph would show the following local structure of the code:

code_graph_from_comment_blocks.png