Appropriate use of coding constructs is evaluated to determine the efficiency of software as it relates to use of RAM. Software is measured against the functional requirements to evaluate fitness for purpose.
Here are two examples of code written in Reference Language that will allocate ten locations in main memory (RAM) to be used to store the names of ten cities.
In the inefficient example, ten different variables are declared individually. This requires much more code to be written and is less efficient than creating an array capable of storing ten elements.