CSSLP · Question #82
Which of the following secure coding principles and practices defines the appearance of code listing so that a code reviewer and maintainer who have not written that code can easily understand it?
The correct answer is C. Use a consistent coding style. Using a consistent coding style is a secure coding principle that ensures code readability and ease of understanding for code reviewers and future maintainers.
Question
Which of the following secure coding principles and practices defines the appearance of code listing so that a code reviewer and maintainer who have not written that code can easily understand it?
Options
- AMake code forward and backward traceable
- BReview code during and after coding
- CUse a consistent coding style
- DKeep code simple and small
How the community answered
(40 responses)- A3% (1)
- B10% (4)
- C85% (34)
- D3% (1)
Why each option
Using a consistent coding style is a secure coding principle that ensures code readability and ease of understanding for code reviewers and future maintainers.
Making code forward and backward traceable connects code to requirements and design, but it doesn't primarily define the visual appearance or immediate understandability of the code listing itself.
Reviewing code during and after coding is a process or activity of secure development, not a principle that defines the appearance or structure of the code itself.
A consistent coding style, encompassing aspects like naming conventions, indentation, and comment structure, significantly enhances the readability and understandability of source code. This practice is crucial for effective peer review and for allowing maintainers who did not write the code to quickly grasp its logic and purpose, which directly contributes to identifying and preventing vulnerabilities.
Keeping code simple and small is a general principle for reducing complexity and potential vulnerabilities, but it is a broader architectural and design guideline rather than specifically defining the 'appearance of code listing' for easy understanding.
Concept tested: Secure coding - consistent coding style
Topics
Community Discussion
No community discussion yet for this question.