Build, part 2 – Year 9 Computing lesson
Pupils learn to make code more maintainable by using meaningful names, comments and functions, without changing what it does.
Lesson 4 of 6 in unit 9.6 Digital Project for a Real User, taught in Year 9, Summer 2. It answers one big question: How do we write code that someone else can understand and change?
By the end, pupils can make code more maintainable by using meaningful names, comments and functions, without changing what it does.
- The Build (the main task)
- Write a maintainable version of the messy league-table code: meaningful names, comments that explain why, and a function show_league(forms, weights) that gives the same output.
- Support version
- A name bank for the variables and a checklist, with the first two renamed lines done as worked examples.
- Challenge
- Add a comment block at the top of the program saying who it is for, what it does and which version it is.
- Real-world link
- Next year someone else may look after the Eco Club's tracker, so pupils make its code easy for another programmer to read and change.
- Key words
- Maintainability, Comment and Readable, each with a definition, an icon and a common mix-up on the key vocabulary slide.
- Misconceptions it tackles
- “Comments change what the program does, or are shown to the user”; “Short one-letter names and fewer lines make code more readable”.
- National Curriculum
- NC7 (creative projects combining applications, including collecting and analysing data for known users); NC8 (create, reuse and revise digital artefacts for an audience: trustworthiness, design, usability); NC1 (design, use and evaluate abstractions that model real-world problems and physical systems); NC2 (key algorithms (e.g. searching and sorting); compare alternative algorithms); NC3 (two or more languages, at least one textual; data structures; modular programs with procedures or functions).
Every lesson follows the same Code & Commerce structure: a Bell Task recall starter, key vocabulary with definitions and icons, short teaching chunks with a check before pupils move on, The Build (one main task), challenge questions that get harder, and an exit question. Answers reveal one at a time on the slides, and everything is editable PowerPoint and Word.
Pupils need computers for the main task.
Also sold in the Digital Project for a Real User unit bundle, which includes the medium term plan, and in the full-year and complete-course bundles.
What's included
- Slide deck (PowerPoint)
- Lesson plan (Word)
- Worksheet (Word)
- Support worksheet with scaffolds (Word)
- Python starter and model programs for the tracker project
- Python starter and model programs for the tracker project
- Single-teacher licence: use and adapt it with your own classes
More for KS3 Computing
See allPupils learn to turn a client's interview notes into clear, testable user requirements, and say who the client and the end users are.
Free sample lessonPupils learn to break the recycling tracker into parts with a structure diagram (typed as an indented list) and write one of its subprograms in pseudocode.
Pupils learn to build the first version of the recycling tracker in small tested steps, saving each working version as a milestone.
Written for the specifications named. Not endorsed by or affiliated with any exam board.