Comments
It is recommended to make extensive use of comments in your scripts. They will help you and others to more quickly understand the way your code works and how to use it (go to Comments for more information).
Naming Comments
When naming variables and functions, always try to use as descriptive names as possible. If an array holds the codes from a question, call it something like codes or q1Codes or similar, not just e.g. a. Similarly, a function that copies a multi question should be called something like CopyMulti, not f1.
A variable name must start with a lower or upper case letter or underscore, and continue with letters, digits or underscore. However, it is recommended to follow the following naming conventions:
-
variablenames and names of methods and properties should start with a lowercase letter in the first word. The next words should open with an uppercase letter. Examples: gridCodes, availableCodes, randomNumber, indexOuterLoop. -
functionnames and names of objects should start with an uppercase in the first word, and have uppercase letters in the beginning of all subsequent words. Examples: CopyMulti, SelectItems, CalculateAverage.