This is a theory about what students need to know and do to meet course goals. It is partially descriptive, and partially prescriptive.
Program goals are underspecified
A program is written to achieve a goal. In RL, goals are often underspecified at the start of a project. Often part of the goal of a programming project is to discover what the goals of the project should be.
For this intro course, we will assume that the goals for each task are known. This allows students to focus on programming, without being distracted by task specification.
Systems analysis is one of the courses students take after this intro programming course. Task specification is a topic in that course.
Programming is pattern adaption
Programmers do basic tasks by adapting procedures that have been successful on similar tasks in the past. The procedures are codified, formally or informally, in patterns. Here, “patterns” is used in the psychological sense of schemas, not in the GoF sense.
At the intro level, students adapt patterns. They do not create their own.
Input-process-output (IPO) is an abstract pattern. Reading an array from a file (RAF) is more concrete, that is, is closer to the code that students write. RAF is one candidate for the I in IPO. Reading an array from the user (RAU) is another.
RAF and RAU might use another pattern, like data filtering (DF). For example, only use data from this year.
Programmers must know some operational details
How to open the VBE, how to start programs, etc.
Programming is designing, testing, and debugging
After understanding the task goal, students design a program by choosing and adapting patterns, and writing code implementing the patterns. They should write a small part of the program, then test it. When their code fails, they should debug it.
- Predicting the program’s state at a certain point.
- Running the program to that point.
- Comparing the predicted state with the actual state.
Debugging starts when there is a difference betwixt the states. Students work backwards from the tested state until they find their mistake.
Errors also have patterns. For example, in Python beginners might think that
l[1:3] returns the first, second, and third elements of a list.
Writing programs involves frustration, anger, and despondency. Students need to be able to continue, regardless.