OCR GCSE Computer Science J277
Systems Architecture
Memory and Storage
Computer Networks, Connections and Protocols
Network Security
Systems Software
Ethical, Legal, Cultural and Environmental Impacts of Digital Technology
Algorithms
Programming Fundamentals
Producing Robust Programs
Programming Languages and Integrated Development Environments
Producing Robust Programs
Writing maintainable code
- 3 things to know
- J277/02
Overview
Why maintainability matters, sub programs, naming conventions and camel case, constants, indentation and comments, and what makes code easy for others to update.
What you need to know
Answer each one before you reveal it.
Why does maintainability matter for a real software product?
How does dividing code into sub programs make it easier to maintain?
Questions from this subtopic
Each one with the model answer underneath.
- 1
What does it mean for a program to be maintainable?
Model answer
A maintainable program is easy for other programmers to read, understand and change. Bugs can be fixed and features added without rewriting it.
- 2
Why does maintainability matter for a real software product?
Model answer
A program is often updated for years, usually by people who did not write it. Clear code makes those fixes faster and less likely to add new errors.
- 3
How does dividing code into sub programs make it easier to maintain?
Model answer
A change to one task is made in one sub program instead of in many places. Each sub program can be tested and corrected on its own.
- 4
What is a naming convention?
Model answer
A naming convention is an agreed set of rules for naming variables, constants and sub programs. A shared convention means every programmer on a team names things the same way.
- 5
Why is averageScore a better variable name than a?
Model answer
The name averageScore describes the data the variable holds. A reader understands the code without having to trace what a stores.
- 6
What is camel case?
Model answer
Camel case joins words without spaces and starts each word after the first with a capital letter. Examples are totalPrice and highScore.
Other ways to work this
The same content, four other ways.
What is inside Levo
Six ways to work the same material.
Every question in Producing Robust Programs, on a schedule.
Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.