Closed papataco14 closed 11 months ago
@papataco14 this particular coding standard rule (i.e., not using a blank line to separate code blocks) will not be used in exam questions because it is rather subjective. However, you should still identify two or more consecutive blank lines as a coding standard violation.
Thank you for the clarification! I checked online and it seems that this rule is left to the discretion of developers and teams. Link
Hi prof, I am confused as to what constitutes a "logical unit". I was under the impression that the coding standards were objective, but this rule seems to be ambiguous.
Here is the relevant section from the textbook regarding this:
☆☆ Logical units within a block should be separated by one blank line.
The example given in the textbook makes sense, but it's hard to judge whether to apply the rule in other contexts. For example, in the mock quiz:
In addition to the other violations, should there be a blank line between the line 2 (declaration of a variable) and line 3 (for loop)? If there is, how should we indicate it for such questions? which line is the error in? If there isn't, why?
Here is the code snippet for ease of reference: