Defensive Design & Testing (OCR GCSE Computer Science): Flashcards
📚Flashcards
Practise the cards
12 cards from this deck
ShowHide
Practise the cards
12 cards from this deck
What is maintainability in programming?
What is maintainability in programming?
Designing programs to be easy to read, understand, and modify
Why is maintainability important?
Why is maintainability important?
Allows efficient updates/fixes without introducing new errors
What are examples of sub programs?
What are examples of sub programs?
Functions and procedures
What are the benefits of using sub programs?
What are the benefits of using sub programs?
Reduces repetition, easier to follow, changes in one place
What do naming conventions involve?
What do naming conventions involve?
Using meaningful and descriptive variable names
Better variable name: totalScore or x?
Better variable name: totalScore or x?
totalScore (clearly states the purpose)
What is the purpose of indentation?
What is the purpose of indentation?
Visually groups code blocks, easier to follow program flow
What does indentation help identify?
What does indentation help identify?
Which statements belong to control structures (loops, conditionals)
What are comments?
What are comments?
Explanations written in code to describe what parts do
Do comments affect how a program runs?
Do comments affect how a program runs?
No, they don't affect program execution
What should good comments explain?
What should good comments explain?
WHY something is done, not just WHAT the code does
How do comments prevent mistakes?
How do comments prevent mistakes?
Clearly outline what each code section is responsible for
