When can children start text-based programming?
Short answer: most children are ready for typed code between seven and nine, but age is the wrong gate. Three abilities matter more, and all three are observable at home in a single session.
Finding
Two independent bodies of evidence point at roughly the same window.
- Developmental stages. In Piaget's account of cognitive development, children move from the pre-operational to the concrete operational stage at around seven. In that stage a child can follow rules and reverse operations on concrete objects, which is what a loop or a condition asks them to do. Before it, rules are applied by imitation rather than by reasoning.
- Curriculum standards. The CSTA K-12 Computer Science Standards are organised into grade bands (K–2, 3–5, 6–8, 9–12) rather than a single starting age, and the programming concepts in the later bands assume the earlier ones. That structure supports what teachers already do in practice — introduce block-based tools first, move to text once a child can read and type — but it is a curriculum design, not a measurement of readiness.
Neither source says "eight years old". Both describe a capability threshold, which is a subtly different thing — and the more useful one.
What it means here
Chapter 1 is written for a child who can do three things, in this order of importance:
- Follow a two-step instruction. Not a complex plan — "open the file, then press run".
- Find brackets and quotes on a keyboard without hunting for ten seconds each time.
- Tolerate being wrong. Run a line, see an error, try again without shutting down.
If the third one is missing, no curriculum will survive; that is a coaching problem, not a coding problem. If the first two are missing, the child is better served by block-based tools or by cause-and-effect games with no typing at all.
This is why the first chapter starts with print() and one visible result, rather than with variables: the goal of the first session is not knowledge, it is the sentence "I typed it and it happened".
Limitations
- Piaget's stages are descriptive, not predictive; individual variation is large, and the ages are approximate.
- The CSTA standards are written for US school systems. Grade bands do not map cleanly onto home learning or onto other countries' curricula.
- Neither source measures children learning at home with a parent, which is the setting most of our readers are in.
Primary sources
- CSTA, K-12 Computer Science Standards — csteachers.org/pk12standards
- Piaget, J., The Origins of Intelligence in Children (1952) and The Psychology of Intelligence (1950) — book references, no stable public URL.
Used in: How to teach Python to kids · Where to start