Writing maintainable code Flashcards
What is the purpose of defensive design in programming?
To anticipate and handle potential errors or misuse
What is the purpose of using comments in maintainable code?
Explain the purpose of the program. Explain sections of code (selections
How can white space improve code readability?
It makes sections of a program easier to see by visually separating them.
Why is indentation important in code?
It makes sections of a program easier to see by visually separating them.
Why is indentation important in code? (duplicate question)
It is used for every selection and iteration branch to improve readability and structure.
What should you consider when naming variables?
Use descriptive variable names and explain their purpose when declared.
What are the benefits of using procedures and functions in code?
Structure the code. Eliminate duplicating code.
Where should user constants be declared in a program?
At the top of the program.