First, that's something you could enforce in a linter. Second, just as
a heads up, `if`/`else` as an expression is actually pretty common -
consider Ruby as one example of this in a very procedural language.
-----

Isiah Meadows
[email protected]

Looking for web consulting? Or a new website?
Send me an email and we can get started.
www.isiahmeadows.com


On Thu, Jan 18, 2018 at 3:29 AM, Naveen Chawla <[email protected]> wrote:
> 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 <[email protected]> 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 <[email protected]> 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 <[email protected]>
>>> 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
>>>> [email protected]
>>>> https://mail.mozilla.org/listinfo/es-discuss
>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to