FWIW, WebGL and GLContext do this for the same reasons.

-jgilbert

----- Original Message -----
From: "Jeff Walden" <jwalden+...@mit.edu>
To: dev-platform@lists.mozilla.org
Sent: Tuesday, January 7, 2014 2:26:46 PM
Subject: Re: Mozilla style guide issues, from a JS point of view

On 01/07/2014 02:23 PM, Boris Zbarsky wrote:
> One reason I've seen 2 preferred to 4 (apart from keeping line lengths down) 
> is that:
> 
>   if (somethingHere() &&
>       somethingElse())
>       doSomething();
> 
> is less clear about what's condition and what's body the if body is than:
> 
>   if (somethingHere() &&
>       somethingElse())
>     doSomething();
> 
> but this would obviously also be affected by the bracing policy.

Regarding the effect of the bracing policy, SpiderMonkey used to have

if (somethingHere() &&
    somethingElse()) {
    doSomething();
}

which was unreadable.  You simply can't easily skim and see where the body 
starts and where the condition ends, even with braces.  We shoved the opening 
brace to its own line:

if (somethingHere() &&
    somethingElse())
{
    doSomething();
}

It doesn't seem to me that the four-space issue here is helped by braces in 
end-of-line configuration.

Jeff
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to