GCSE · Computer Science · Eduqas · Spec C500QS

Comparing approaches to requirements

Two programmers each hand you a working solution to the same job. Both give the right answers. Which one do you pick, and how do you prove you picked well?

Weigh it up

Which program would you hand to the next programmer?

The claim

For this job, Approach B is the more suitable choice. THE JOB: a school needs a program that reads 20 test marks and outputs the total, the average and the highest mark. It will run once a week, and the department expects to ask for more outputs later, so other teachers will need to edit it. APPROACH A: one loop in one long block that works out all three results in a single pass; variables are called t, h and n; no comments. APPROACH B: separate subroutines called calculateTotal, calculateAverage and findHighest, each with a comment; calculateTotal and findHighest each go through the marks separately, so B goes through them twice. Both give the right outputs.

Place each piece of evidence to load the balance. Mark the strong ones — they count double.

  1. Approach A uses names like t, h and n and has no comments, so another programmer has to work out what each variable is for.

    Evidence 1: does it support or challenge the claim?
  2. To add a new output later, such as the lowest mark, B only needs a new subroutine such as findLowest. A would mean editing the middle of its long block.

    Evidence 2: does it support or challenge the claim?
  3. The requirements say nothing about speed, and with only 20 marks run once a week, B's extra pass through the data is tiny.

    Evidence 3: does it support or challenge the claim?
  4. Approach A goes through the marks once. Approach B goes through them twice, so A needs fewer processing steps for the same result.

    Evidence 4: does it support or challenge the claim?
  5. Approach A already gives the total, the average and the highest mark correctly, so it meets the requirements just as fully as B does.

    Evidence 5: does it support or challenge the claim?
  6. If the requirements changed to processing a very large number of marks every day, B's extra pass would count for much more.

    Evidence 6: does it support or challenge the claim?

The four points of comparison

Apply each point to every approach

Three approaches to the test-marks job from the balance. Approach A: one long block, one pass, names t, h and n, no comments. Approach B: well-named, commented subroutines, two passes. Approach C: short, clearly named and commented, one pass, one block, but it forgets to output the average. Tick the cells you think are Yes, then check.

Approach A (one long block)
Approach B (subroutines)
Approach C (clear but incomplete)

Efficiency, as a number

How many extra steps does a repeated calculation cost?

A program must print a running total after each of 100 test marks. Method X starts again from zero after every new mark and adds up every mark so far. Method Y keeps one running total and adds only the newest mark. Method Y does 100 additions in all. Both methods print exactly the same totals. About how many additions does Method X do?

Your estimate

5000 additions

0 additions10000 additions

Which idea is closest to yours?

Choosing between approaches

Two programs are written for the same requirements. Both run and both give correct results. Your class is arguing about how to pick one.

Which of these is closest to what you think right now?
How sure are you?

Your turn to write

Compare two approaches in your own words

REQUIREMENTS: a library program must read the 30 book titles on a shelf and print the longest title. The librarian will keep asking for extra features, so other programmers will need to add to it. APPROACH P: one long block with variables called a, b and c, no comments. It goes through the titles once. APPROACH Q: a subroutine called findLongestTitle with a comment, clear variable names, and the printing kept in a separate subroutine. It also goes through the titles once.

Compare the two approaches below and say which is more suitable for the requirements. [4 marks]

0 words · your answer stays on this page and is not sent anywhere.

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

Two programs, one job, both work. How do you decide which one to hand over?

What you need to know

  • The same requirements can usually be met by more than one approach, such as different program designs, algorithms or data structures.
  • Comparing approaches means listing each one's advantages and disadvantages against the same requirements, so you can justify a choice.
  • One point of comparison is how fully the requirements are met. An approach that leaves one unmet, or meets it only partly, is weaker whatever its other strengths.
  • Have a goYour friend Sam says: "My program is lightning quick. Shame it never prints the average the teacher asked for, but speed beats everything, right?" Is it stronger or weaker than a slower one that prints everything?

    Weaker.

    An approach that leaves a requirement unmet is weaker whatever its other strengths, so speed cannot cover for a missing output.

  • Another is ease of understanding. A clear, simple structure, meaningful identifiers and comments are easier for another programmer to follow than a complex or obscure design.
  • Have a goWhich would another programmer thank you for: "t = t + m" or "totalScore = totalScore + newMark"?

    totalScore = totalScore + newMark

    Meaningful identifiers tell the reader what each value is, so the design is easier to follow. The shorter line is not the clearer one.

  • Efficiency means fewer processing steps, such as fewer passes through the data or fewer repeated calculations, or less memory or storage for the same result.
  • Maintainability means a program split into well-named subroutines or modules, without duplicated code, is easier to correct, change or extend than one long block.
  • Trade-offs are common. One approach may be more efficient but harder to understand or maintain, so you weigh each advantage against each disadvantage.
  • Have a goA program is split into three well-named subroutines, but to get the same answer it goes through the data three times instead of once. Name one advantage and one disadvantage.

    Advantage: easier to correct, change or extend. Disadvantage: less efficient, with more passes.

    That is a trade-off: it gains on maintainability and gives something up on efficiency, so you weigh the two against the requirements.

  • What the requirements need decides how much each point weighs, so the same two approaches can rank differently for different requirements.
  • A reasoned comparison makes a point about each approach, explains its effect on how well the requirements are met, then reaches a justified conclusion.

The big picture

The same requirements can usually be met in more than one way. To choose, you compare the approaches on how fully they meet the requirements, how easy they are to understand, how efficient they are and how maintainable they are. Most choices involve a trade-off, so you weigh each advantage against each disadvantage in the light of what the requirements need, then justify a conclusion.

Key points

1The same requirements can usually be met in more than one way, so comparing approaches means judging them against the same requirements.
2Four points of comparison: how fully the requirements are met, ease of understanding, efficiency and maintainability.
3An approach that leaves a requirement unmet, or meets it only partly, is weaker than one that meets every requirement, whatever its other strengths.
4Approaches often involve trade-offs, so each advantage is weighed against each disadvantage in the light of what the requirements need.
5A reasoned comparison gives a point about each approach, the effect of that point on the requirements, and a justified conclusion.

Worked example

Problem

Two programs both print the 12 times table for a number the user types. Program P has twelve separate print lines, one for each row. Program Q has one loop that prints twelve rows. The school says that next term the table must run to 20 rows. Which program is more suitable? Compare them.

⚠ Watch out

Picking whichever approach looks cleverest, usually the fastest or the shortest, without checking it against the requirements. That ignores unmet requirements and future changes, and it never justifies the choice.

🧠

Memory hook

Job, Read, Lean, Grow. Does it do the whole job? Can another person read it? Is it lean on steps? Can it grow later? Then ask what the requirements need most.

✓

Check yourself

Flip the requirements: the same two programs must now process huge amounts of data every night, and nobody will ever edit them. Does your choice change? Which point now matters most, and why?

Flashcards

(10)
What does it mean to compare approaches to requirements?
Identify the advantages and disadvantages of each approach against the same requirements, so you can make a justified choice between them.
Why can one set of requirements have several correct programs?
The same requirements can usually be met by more than one approach, such as different program designs, algorithms or data structures.
Point of comparison: how fully the requirements are met. What does it ask?
Does the approach meet every requirement, only part of one, or leave one unmet? Meeting every requirement is stronger.
Point of comparison: ease of understanding. What makes an approach easier?
A clear, simple structure, meaningful identifiers and comments, so another programmer can read and follow it.
Point of comparison: efficiency. What makes an approach more efficient?
Fewer processing steps, such as fewer passes through the data or fewer repeated calculations, or less memory or storage, for the same result.
Point of comparison: maintainability. What makes an approach easier to maintain?
Well-named subroutines or modules and no duplicated code, so it is easier to correct, change or extend later.
What is a trade-off between approaches?
Gaining on one point while losing on another, for example more efficient but harder to understand or maintain.
An approach leaves one requirement unmet. How does it compare?
It is weaker than an approach that meets every requirement, whatever its other strengths.
What are the three parts of a reasoned comparison?
A point about each approach, the effect of that point on how well the requirements are met, and a justified conclusion about which is more suitable.
How do you decide which point of comparison matters most?
By what the requirements need. Weigh each advantage against each disadvantage in that light.

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 posted

More Eduqas GCSE Computer Science topics

See the full Eduqas Computer Science curriculum →

How this lesson was checked. This Eduqas GCSE Computer Science (specification C500QS)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 16 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.