Reading code means following choices someone else made. Writing means making those choices yourself, and that needs a planning routine, not more syntax.
This page is for the moment you face a task and cannot begin. The routine below bridges the gap between the words of the task and the first line of code.
Why does reading feel easier than writing?
When you read, the variables already exist and the steps are in order. When you write, you must first decide what to store, what repeats, and when to stop.
Students skip those decisions and look for a line to copy. The fix is to make the decisions on paper before any code appears. This connects to breaking a problem into smaller tasks.
What is the five-step routine?
- Write the task in your own words.
- List the inputs and the outputs.
- Decide what must be stored while the program runs.
- Write the steps in plain words.
- Turn each step into pseudocode, then trace it on a tiny example.
A worked example
Task. Five test marks are entered. Display how many marks are 50 or above.
Steps 1 to 3. The inputs are five marks. The output is one count. One variable, passCount, must be stored, starting at 0.
Step 4. Repeat five times: read a mark, and if it is at least 50, add 1 to passCount. After the loop, output passCount.
Step 5.
passCount ← 0
FOR i ← 1 TO 5
INPUT mark
IF mark >= 50 THEN
passCount ← passCount + 1
END IF
END FOR
OUTPUT passCount
Trace it with the marks 48, 50, 72, 39 and 65. The count moves 0, 1, 2, 2, 3, so the output is 3. The value 50 counts, because the test is “at least 50”.
How can you practise without copying?
Take a short program from your notes and trace it with a table. Close the notes, read only the table, and rebuild the code from it. Compare your version with the original and note the first line that differs.
Use the restricted pseudocode trace trainer for tracing practice, and log the slips in the mistake log. Then move to programming foundations for loops and selection lessons.
A self-check
Write the five steps for this task: input four temperatures and output the highest. Then ask which variable you must store, and what its starting value should be.
The answer is that you store highest, and start it at the first temperature, not at 0, in case every reading is below zero.
When is one-to-one tuition worth considering?
If you have tried the routine and still cannot begin, the gap is probably step 3, deciding what to store. A teacher can listen as you explain your plan aloud and stop you at the exact decision that stalls.
You can test this in the one-hour trial class (from RM50), a taught lesson on the topic you choose. See also online one-to-one Computer Science tuition.