Coding
Teaching coding online: how to make students think, not copy
In online coding lessons, students easily copy code without understanding it. These activities get them reading, tracing and predicting before they type.
Coding lessons online often turn into screen sharing: the teacher types, students copy, and nobody is sure what anyone understood. The fix is to spend more of the lesson on reading and reasoning about code, and less on typing it.
1. Predict the output first
Show a short piece of code and ask what it prints before anyone runs it. Take a few answers, then run it. When the prediction is wrong, students want to know why, and that is the best moment to explain.
2. Trace it on paper, or the board
A trace table, with a column for each variable and a row for each step, shows exactly how a loop changes things. Fill one in together, then let students trace the next loop on their own.
3. Find the bug
Give students code that almost works. Finding one wrong line teaches more about how code runs than writing ten correct ones from a template.
4. Draw it before you write it
A flowchart with decisions makes students plan the logic before worrying about syntax. It also works for students who are not yet confident with any one language.
5. Make the ideas behind computers visible
Binary and logic gates are easier to understand when students can change them and see the result: switch a bit and watch the number change, flip an input and watch a gate's output. Ask them to make a target number or a target output.
6. Write code together
A shared editor that everyone can type in turns "watch me" into "let's write it". Ask one student to start a function and another to finish it, and talk through each line as it appears.
7. Compare two answers
Most problems have more than one solution. Put two students' answers side by side and ask which is clearer, which is shorter and whether both are right. Students learn to read code critically, which is half of programming.
The short version
Predict, trace, debug, draw, and compare. When students spend the lesson reasoning about code, the typing takes care of itself.