levo

Producing Robust Programs

Writing maintainable code

  • 3 things to know
  • J277/02
Start revising · £5/month

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.

Your recallNot started
Key term

What does it mean for a program to be maintainable?

Key term

Why does maintainability matter for a real software product?

Key term

How does dividing code into sub programs make it easier to maintain?

Questions from this subtopic

Each one with the model answer underneath.

  1. 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. 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. 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. 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. 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. 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.

Everything in your subscription

Runs, plus a mode for every other kind of session.

1Flash
2Imposter
3Fade
4Brain dump

Learn every subtopic in runs of four questions

Facts flash and fade, a wrong word hides in some of them, and a brain dump decides which questions are locked in.

Systems Architecture
Memory and Storage
Computer Networks, Connections and Protocols
Network Security

Cram the night before, weakest topic first

A quick scan finds your weakest topics. Recall each fact you missed three times in a row.

A bit is the unit of data.
smallestlargestmain

Blank Blitz consolidates the facts

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

✓What it iscovered
~Why it happenspartly there
How long it lastsnot there yet

Explain It tests your understanding

Explain a concept in your own words and see which of its points you covered.

Integer means a whole number with no fractional part.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The faults are the mistakes students make most often.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Producing Robust Programs, on a schedule.

Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.