6.1.4: be able to use techniques (layout, indentation, comments, meaningful identifiers, white space) to make programs easier to read, understand and maintain
Keyword | Definition |
---|---|
comments | code is easier to read when each line or section of code is described in a way that helps other programmers understand what it does |
identifiers | code is easier to read when variables, constants and sub programs have names which describe what they store or do |
indentation | code is easier to read when tabs or spaces are used to move blocks of code across to the right. This is necessary in python but optional in other programming languages |
layout | code is easier to read when it is organised into sections e.g. imports, constants, global variables, sub programs then the main program code |
whitespace | code is easier to read when blank lines are used to break the code into logical paragraphs |