E. Good Programming Practices
Previous Topic  Next Topic 

Before we leave this question, we want to clean up our algorithm definitions list by adding comments and ordering the list.  This is an optional section, but we include it because weve found this practice ultimately saves time.  In fact, weve already discussed a good programming practice in Part C, Step 3, when we decided that we would use the code “Disp” in the name of a display variable with a string value so we wouldnt use it for calculation by mistake.

Step 1: Why practice good programming?

There are a couple of good reasons why we should apply good programming practices to our algorithm lists.

1. Most importantly: It makes the definitions list readable.

This is vitally important, particularly if we are planning on sharing our banks with other educators.  Its also important just to us.  Frequently, we want to adapt our banks or use them with other applications.  Even if the delay between creation and adaptation is only a couple of weeks, its very easy to forget exactly what is what.  Readability is crucial. 

2. It makes the list of algorithm definitions adaptable to many more questions.

As we have seen, defining the algorithms variables, conditions, functions, and constants is the most time-consuming aspect of our work. If we can reuse our algorithm list, we save time. When we duplicate a question, in effect we are reusing our list.

Step 2: Order the variables.

Our ordering technique is

    1. Function Algorithms,
    2. Question Variables and Conditions and
    3. Rationale Variables and Conditions. 

Of course, you may select any order that helps you with readability, provided that functions come before their use and conditions come after the definitions of the variables they use.

With our ordering technique, we need only to move the function CC(x) to the top of the list.

Step 3: Explain definitions.

EVP offers a way to “comment” our algorithm definitions; that is, to add a short text explanation of the meaning of the definition.  We make it a policy to comment any definition not used directly in the text of the question or rationale.   

The only definition not used directly is CC(x).

Here is our list of Algorithm Definitions.

Step 4: Save the file


Parking Place