Paren-free heads strawman

Brendan Eich brendan.eich at
Mon Feb 1 17:46:05 UTC 2016

On Mon, Feb 1, 2016 at 8:02 AM kdex <kdex at> wrote:

> [Douglas Crockford]( and
> [Brendan Eich]( seem
> to be in favor of making them optional; that's why the strawman exists.
The strawman exists because I wrote it, yes.

I was inspired by the common (not ubiquitous) style of always bracing
sub-statements. The paren-free meme did "stick" with Rust, but it seems
doomed for JS on account of the problems Waldemar Horwat raised:

Not the cited example, that seemed to forget that paren-free requires
braces around the sub-statement in absence of leading left paren after
controlling keyword. I pointed this out here:

Waldemar's other example showed a refactoring hazard:


if (a + b/g > f) f = a + b/g

Convert it to paren-free:

if a + b/g > f {f = a + b/g}

So far so good; it works. However, later someone discovers that the code
had a logic error, the fix to which is to divide the sum a+b by c instead
of dividing only b by c. So he fixes the code to:

if (a + b)/g > f {f = (a + b)/g}


Anyway, the proposal predates 1JS (note my last message talks about "opt
in") and needs a champion who can resolve the refactoring hazard worry (if

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list