Live data from Hacker News

What’s New in ES2019

blog.tildeloop.com

1–10 of 411 posts

Re: What’s New in ES2019

#3
It's great to see JS getting some of the features of better planned languages.

But I'm still very nervous about some of the stuff mentioned here with regard to mutation. Taking Rust and Clojure as references, you always know for sure whether or not a call to e.g. `flat` will result in a mutation.

In JS, because of past experience, I'd never be completely confident that I wasn't mutating something by mistake. I don't know if you could retrofit features like const or mut. But, speaking personally, it might create enough safety-net to consider JS again.

(Maybe I'm missing an obvious feature?)

Re: What’s New in ES2019

#5
post #4
post #2

.

Doesn't the fact that flatten by default only flattens one level mean you can still create nested output by emitted nested outputs?

Yes, it appears so. From MDN:

> The flatMap() method first maps each element using a mapping function, then flattens the result into a new array. It is identical to a map() followed by a flat() of depth 1, but flatMap() is often quite useful, as merging both into one method is slightly more efficient.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re: What’s New in ES2019

#6
The part about parameter less catch reveals a lot about the philosophy of the language. For me, silencing error like this is a bad practice. You may still produce a sane error in the catch, but the design goes toward silencing things.

I really love languages that force you to handle errors up to the top level.

Re: What’s New in ES2019

#7
post #3

It's great to see JS getting some of the features of better planned languages. But I'm still very nervous about some of the stuff mentioned here with regard to mutation. Taking Rust and Clojure as references, you always know for sure whether or not a call to e.g. `flat` will result in a mutation. In JS, because of past experience, I'd never be completely confident that I wasn't mutating something by mistake. I don't…

Mutation is a real weakness of Javascript. I think the general idea is "methods don't mutate unless they are ancient". For example Array.map (an IE9-era feature) doesn't mutate, Array.sort (an IE5.5-era feature) does. Similarly a "for(let i=0; iProper immutable support (or a stronger concept of const) would also help with this.

Re: What’s New in ES2019

#9
post #3

It's great to see JS getting some of the features of better planned languages. But I'm still very nervous about some of the stuff mentioned here with regard to mutation. Taking Rust and Clojure as references, you always know for sure whether or not a call to e.g. `flat` will result in a mutation. In JS, because of past experience, I'd never be completely confident that I wasn't mutating something by mistake. I don't…

In other words you’re concerned that some Array methods mutate the array (push, pop) and some don’t (map, concat)?

If so then yeah, that can be annoying and/or confusing.

Re: What’s New in ES2019

#10
post #8

That’s a surprisingly small amount of change. I’ll leave it to others to determine if that’s a good or bad thing.

Clojure too didn't change a lot. In these years of 'disruption' it feels odd. But it may just be that we forgot stability and maturity.
Post reply on HN