Simplicity in program design
Keep It Simple: solve the problem with the clearest, shortest logic, avoiding extra complexity and giving each function one job, so code is easier to read, test and maintain.
Understanding Simplicity in program design in QCE Digital Solutions Unit 1
What it does: calc_average only calculates an average. It does not ask for input or print anything, so it has a single job. The comparison already gives True or False, so returning it directly is shorter and clearer than a longer if-else. Clever tricks often make code harder to read, test and maintain. Clear logic is the goal of KISS. A function with one job is easier to name, test and reuse. The second function does four jobs, so a bug could hide in any of them. Avoid unnecessary complexity. If a simpler solution does the same job correctly, it is easier to read and maintain.
Common mistakes: A single = assigns a value and is invalid inside a return. Use == to compare. The one-line return keeps this function simple and focused on one job. An average is the total divided by the count, so it should be total / count. Multiplying gives the wrong answer.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 158–380) and word search (Modules 82–380).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
KISSFill in the Blanks
Spot the Error
Student with a class code? Join your class →