Optional Curly Braces in JavaScript

Bergi a.d.bergi at web.de
Sun Nov 3 21:05:36 UTC 2019


Hi!

> If it's possible in JavaScript to have `:`, and enable significant spacing, that would be great.
>
> Why you don't *want* to?

Your argument for significant whitespace seems to be that the simplicity
of Python is great. However, adding an alternative block syntax to
JavaScript would fail to achieve this goal, in contrast, it would only
make the language more complex.

So no, my educated guess is that it's not possible for you to persuade
the wider community and especially the technical committee to accept
your proposal. They are very reluctant to add features that don't show a
clear benefit.

Since you asked for my personal feedback: JS syntax was influenced by C
and Java, and it will consistently keep its curly braces. A different
block style would only be a viable choice for a new language or dialect,
which should not allow curly braces at all, and would not provide
backwards compatibility.

kind regards,
 Bergi


More information about the es-discuss mailing list