Oh, and also, I don't like the idea of allowing if-elses to be turned into expressions. That's what ternaries are for. Again, this harms readability and is another surface area for the "accidental code after last executed statement" bug I mentioned in my last post.
On Thu, 18 Jan 2018 at 13:53 Naveen Chawla <naveen.c...@gmail.com> wrote: > Also, I don't find it very readable/clear when reading it in code. Maybe > I'm missing the whole point, but the comma operator forces you to wrap each > non-expression language construct (e.g. for loops) into a function, which > makes the expression itself clearer (in my opinion) than a do-expression. > > Also, it's very easy to accidentally add code after the last statement, > breaking the code and hence causing bugs! > This is not as much the case with the comma operator, since you have to > add a comma, which is not "normal" in ordinary function code vs a semicolon) > > Altogether, I'd be happier if it wasn't introduced. > > On Thu, 18 Jan 2018 at 13:29 Naveen Chawla <naveen.c...@gmail.com> wrote: > >> I'm not necessarily in favour of the proposal. I think the comma operator >> feature in current javascript already covers at least some of the use cases. >> >> On Thu, 18 Jan 2018 at 01:58 Peter Jaszkowiak <p.jasz...@gmail.com> >> wrote: >> >>> https://github.com/tc39/proposal-do-expressions >>> >>> It appears that the do-expressions proposal, which has a high amount of >>> interest, is currently inactive. There haven't been any contributions from >>> @dherman since September. >>> >>> This concerns me because the proposal is a hugely simplifying feature, >>> which would make the language much more concise. >>> >>> Currently there are multiple instances of duplicate issues and the lack >>> of input means the proposal is going nowhere. >>> >>> What's going on? >>> _______________________________________________ >>> es-discuss mailing list >>> es-discuss@mozilla.org >>> https://mail.mozilla.org/listinfo/es-discuss >>> >>
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss