Exponentiation operator precedence

Mark S. Miller erights at google.com
Thu Sep 24 15:14:51 UTC 2015

I like #4. Normally in a situation like this I would still argue for #1. #4
is a complicated special case that breaks the normal pattern of operator
precedence elsewhere in the language. The need for ** is not great enough
to justify introducing a new special case for users to learn.

However, in this case, #4 is only technically complicated -- for those
writing or reading spec docs like us. For normal users, the only complexity
is a rarely encountered surprising static error. With a decent (and easy to
generate) error message, these users will immediately know what they need
to do to repair their program.

Significant programs are read much more than they are written. Both #2 and
#3 will lead many readers to misread programs. For programs that are not
rejected, #4 is no more confusing than #1. Altogether, for readers, #4 is
better than #1 because ** is more readable than Pow.

+1 on #4.

On Thu, Sep 24, 2015 at 7:55 AM, Brendan Eich <brendan at mozilla.org> wrote:

> Here's a nicely formatted jsbin version of my message:
> http://jsbin.com/bihilaveda
> Sorry about the mess, mail user agents (at least Postbox) and archive
> software do not like explicit indentation.
> /be

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150924/c0737a14/attachment.html>

More information about the es-discuss mailing list