Coding Practice
Write programs to build muscle memory for the exam
What the Research Says
Programming is a practical skill that improves with active practice, not passive reading. Students who write code regularly develop stronger problem-solving abilities and make fewer syntax errors under exam conditions.
Evidence Base
| Study | Finding | Impact |
|---|---|---|
| Robins et al. (2003) | Novice programmers who practised writing code improved faster than those who only read code examples. | Active > passive |
| Ericsson (2006) | Deliberate practice with feedback is the single strongest predictor of programming skill development. | Skill development |
| Pea (1986) | Common programming misconceptions are resolved through hands-on debugging, not through instruction alone. | Deeper understanding |
Step-by-Step Method
- 1Set a challenge — Use past paper questions, coding challenges, or set yourself tasks: “Write a program that validates a password.”
- 2Plan before coding — Write pseudocode or draw a flowchart first. This mirrors the exam process.
- 3Write the code in Python — Type it out (do not copy-paste). Use meaningful variable names and add comments.
- 4Test with multiple inputs — Try normal data, boundary data, and erroneous data. Does your program handle all three?
- 5Rewrite on paper — After getting the code working, close your laptop and rewrite it by hand in pseudocode. This is how you will write it in the exam.
Write a program that asks the user for a number between 1 and 100. If they enter something outside this range, keep asking until they enter a valid number. Use a while loop with a range check.
Create an array of 10 names. Ask the user for a search term and perform a linear search. Output the index if found, or “Not found” if not. Add a count of comparisons made.
Write a program that reads a CSV file of student scores, calculates the average, and writes the result to a new file. Include error handling for missing files.
Common Pitfalls
- Only running code you copied — Typing someone else’s code teaches you nothing. Write your own solutions from scratch.
- Never testing edge cases — Your program works for normal input but crashes on empty strings or negative numbers. Test everything.
- Skipping the paper stage — The exam is on paper, not a computer. If you only ever type code, writing it by hand will feel strange.
When to Use This
Code for 20–30 minutes at least 3 times per week. Start with simple challenges and increase difficulty. In the final month, focus on past paper coding questions and write solutions on paper first.