6 ms·
I couldn't help but search the pdf for brace rules, and lo: AV Rule 60 Braces ("{}") which enclose a block will be placed in the same column, on separate line
by rvkennedy 12y ago
I couldn't help but search the pdf for brace rules, and lo:
AV Rule 60
Braces ("{}") which enclose a block will be placed in the same column, on separate lines directly before and after the block.
Example:
if (var_name == true)
{
}
else
{
}
- exelius 12y agoHey, nothing wrong with that. As long as there's a consistent standard, it does make things more readable.
- rootbear 12y agoI agree about consistency but I don't find that style more readable. It wastes vertical space to little benefit.
- john_b 12y agoI agree with you stylistically and don't personally use that brace placement. However, given the number of people writing C++ code for the F-35, it makes sense to settle on a standard that is never ambiguous. When nesting multiple control statements, it can sometimes require good judgment to know where to place braces for maximum readability. Giving each one its own line avoids requiring your developers to exercise good judgment in all the myriad cases.
- exelius 12y agoYeah, but that's a stylistic choice. IMO this is one of those cases where one choice isn't better than another, and it's just better to have made a decision.
- Too 12y agoI think he's referring to apples "goto fail" bug to show it wouldn't happen under a project with strict guidelines :)