From:  Benjamin Bouvier <>
Date:  05 Sep 2018 17:29:06 Hong Kong Time

Re: Proposal: always use braces for if/for/while statements


I don't buy Jeff's argument at all; in the case of the (in)famous Apple SSL
bug, there *was* proper indentation and missing braces on the if, and
though this wasn't enough to catch the failure. Meta bug 1297639 has
dependents that show real-world issues because of missing braces, including
in Gecko.

I'm all in for the new rule:
- for consistency with Gecko (and future happy tooling with clang-format)
- less cognitive load for contributors
- harder to make a mistake
- tools to catch these errors automatically are imperfect at the moment: if
the if-body-one-liner is a macro that expands on several lines (without
braces), gcc 7.3 with -Wmisleading-indentation doesn't catch it [1]. (of
course it could be fixed in gcc itself, but that means being unprotected
until we get this feature in stable GCC, and GCC updated in all the major
distributions; note there might issues other than macros which I haven't
thought of)


[1] example:

On Tue, Sep 4, 2018 at 8:05 PM Jeff Walden  wrote:

> On 09/04/2018 10:59 AM, David Teller wrote:
> > Point taken. Not going to fight over this :)
> :-) ^ 2
> Jeff
> _______________________________________________
> dev-tech-js-engine-internals mailing list