Hacker News new | ask | show | jobs
by rvkennedy 4434 days 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

{

}

1 comments

Hey, nothing wrong with that. As long as there's a consistent standard, it does make things more readable.
I agree about consistency but I don't find that style more readable. It wastes vertical space to little benefit.
I 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.
Yeah, 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.
I think he's referring to apples "goto fail" bug to show it wouldn't happen under a project with strict guidelines :)