GCSE · Computer Science · AQA · Spec 8525
Advantages of structured approach
A program that says 'jump to line 240' every few lines is a nightmare to fix. That tangle is called spaghetti code, and here is the cure.
Computer Science · Structure
Structure chart: a grade-report program (invented example)
Tap a box to see its one task and its interface.
Tap any part of the diagram to see what it does.
Computer Science · Algorithms
Trace table — dry run the code
Step through one subroutine being called twice, and watch what goes in and what comes back.
Ready when you are — step through one line at a time.
Computer Science · Structured programming
Which advantage is it?
Which advantage of a structured approach does this scenario show?
Still to sort
Readability (0)
Reading and checking small sections.
Where the line is: It is about reading a section, not about running tests on it or changing it.
Testing (0)
Checking that a section works, and finding mistakes in it.
Where the line is: It is about checking and finding mistakes, not about changing a program that already works.
Maintenance (0)
Changing a program that already exists.
Where the line is: It is about updating without breaking the rest, not about finding mistakes in new code.
Development time (0)
Getting a large program built sooner.
Where the line is: It is about several people building at once, not about reusing code that is already written.
Reuse (0)
Calling the same subroutine again and again.
Where the line is: It is about calling existing code many times, not about several people writing different code.
Each scenario below shows one of the five advantages. Choose the box you think it belongs in before you read why.
WHAT YOU'VE LEARNED
A quick recap of today's lesson.
Why splitting a program into named subroutines makes it easier to read, test, change, share out and reuse
What you need to know
- Structured programming controls flow with selection (if, elif, else) and loops (while, for), not go-to statements.
- Too many go-to jumps made code messy and hard to follow, so it was nicknamed spaghetti code.
Have a goJo swears that spaghetti code means a program that has gone cold and sticky. What is the nickname really about?
Too many go-to statements made the code messy and hard to follow.
The name describes the tangle of jumps that is hard to follow, not anything to do with how a program is cooked or run.
- In a structured approach, a program is decomposed into smaller sections called subroutines, and the main program calls them.
- A subroutine is a sequence of instructions with an identifiable name that performs one specific task.
- A structure chart plans the hierarchy: the main program is the top box, with a box for each subroutine beneath it.
- A subroutine's interface is its identifier (a meaningful name), its parameters (values passed in) and its return value (value passed back).
Have a goA subroutine called count_words takes in a sentence and passes back how many words it has. Name its identifier, its parameter and its return value.
Identifier: count_words. Parameter: the sentence. Return value: the number of words.
The parameter is the value that goes in, and the return value is the value that comes back to the main program.
- Readability: it is easier to read and check small sections of code than one very large program.
- Testing: a single-task subroutine is easier to test, and less code in each section makes mistakes easier to find and fix.
- Maintenance: a change can be made and tested in one place without affecting the rest of the program.
Have a goA date-formatting subroutine in a structured program needs changing. Where does the change get made and tested?
In that one subroutine, in one place.
The change can be made and tested in one place without affecting the rest of the program, so the main functions are not disrupted.
- Development time and reuse: a team can build subroutines at the same time, and a subroutine can be called many times.
The big picture
A structured program controls its flow with selection and loops instead of go-to statements, and it is divided into named subroutines that a main program calls. A structure chart plans that layout, and the layout is what makes the program easier to read, test, maintain, build as a team and reuse.
Key points
Worked example
Problem
A shop's structure chart has a subroutine total_cost(price, quantity) that hands back the cost of an order. State its identifier, its parameters and its return value, then say what the main program receives when it calls total_cost(4, 3). (In this invented example, the subroutine multiplies price by quantity.)
⚠ Watch out
Thinking a structured approach is about making the finished program run faster. The five advantages are gains for the programmers: easier reading, testing, maintenance, team development and reuse.
Memory hook
Read it, Test it, Mend it, Share it, Reuse it. Mend is maintenance and Share is development time, because the work gets shared between programmers.
Check yourself
A team is building a large program. Which advantage does it show when each programmer takes a different subroutine and they all write them at the same time?
Flashcards
(13)What does structured programming use to control the flow of a program?
Why is heavy go-to code nicknamed spaghetti code?
What does it mean to decompose a program?
What is a subroutine?
What does a structure chart show?
What is the interface of a subroutine?
What is a parameter?
What is a return value?
Readability: why is a structured program easier to read?
Testing: why does a structured approach help?
Maintenance: what does a structured approach allow?
Development time: how does a structured approach speed things up?
Reuse: what does a subroutine save you from?
Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.
Learning with Lightbulb is opening soon
You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.
Keep me postedMore AQA GCSE Computer Science topics
How this lesson was checked. This AQA GCSE Computer Science (specification 8525)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 24 November 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.