Requiring braces when optional seems far too domineering, yet would be tolerable. Forbidding braces when optional may be the most insane coding standard I’ve ever heard of. Is this supervisor an efficiency nut worried about the extra NOP’s needed for the { and } ?
It’s an open-source project that has its origins in the days when everything was down through terminals and every line was sacred.
No, that’d be completely intolerable, since it’d mean infinitely-regressive code bloat. You can always add more optional braces.
I guess you’re implying that that standard would require that
if (0) /* we never come here */ {
/* but do nothing if we do */
}
be replaced with
if (0) /* we never come here */ {
/* but do nothing if we do */
{{{{{{{{{{{{{{{{{{{{{
/* sure hope we're not using that old gcc with the memory bug! */
.......
}}}}}}}}}}}}}}}}}}}}}
}
Modifying the “mandatory braces” to apply only when enclosing a non-null statement, would you agree it’s a superior standard to the “forbidden optional braces”? And if the forbidden braces are not the insanest standard you’ve ever heard of, what is?