Live data from Hacker News

What’s New in ES2019

blog.tildeloop.com

321–330 of 411 posts

Re: What’s New in ES2019

#321
post #139

Earlier quoted context omitted.

That's not unique to JS. Some compilers took over a decade to implement C99 features. Most of us C coders were still defaulting to C89 for portability well into the late 00's. But now C99 is mainstream enough that you can (mostly) safely target it. If you never release new standards you'll never be able to use them. I realize that in JS world 4 years is basically an eternity so it's hard to project that far but I'm s…

> Regarding transpilation surely it's not as standard as you make it out to be? The impression I got from working on various projects over the past couple of years was that if the build doesn't include Babel/Webpack/Packet/etc then you're not doing a 'professional' job. > ... handwritten javascript is not that rare nowadays, is it? I love handwriting vanilla javascript, though I only really get the opportunity to do…

Agreed! My personal project is vanilla JS, no dependencies, and no attempt to support old browsers, and it's so much fun to work in. And, since Real Life sometimes puts side projects on hold for a year or two, it's nice to know that picking it back up won't involve re-learning, updating or replacing a bunch of stuff I've forgotten the details of.

Re: What’s New in ES2019

#322
post #280

Earlier quoted context omitted.

And in the idealized fantasy world of Ayn Rand, any giant dinosaur enterprise corporation who insists on using antique outdated Jurrasic browsers deserves to be bitch-slapped by the invisible hand of the market into extinction for their outrageously dangerous security and privacy policies. To bad the real world doesn't work the same as it does in self-indulgent libertarian porn...

The real world works exactly like that. It's called System Requirements . If you want to use a piece of software, you look at the requirements and if you don't meet the requirements then you can't install it. All websites have system requirements, no matter how non-libertarian they seek to be, for example most websites will not work on IE6. It is not a fantasy to inform users that they don't meet the requirements, it…

This is especially true for businesses. I've had a few cases where clients balked at browser support policies but when presented them with the cost multiplier it'd add, not to mention the cost of features / security, that clicked it into a calculation and suddenly it turned out that the “hard requirement” was actually one VP who refused to upgrade from IE5 Mac and they decided not to pay more for that.

Re: What’s New in ES2019

#323
post #246

Earlier quoted context omitted.

I adore pattern matching when done well, but I'm sorry -- that syntax seems terrible and confusing. The use of `{ }` seems arbitrary. In JS braces are already used for both scope-delimiting and object literal notation; now they're going to have a third job? There has to be a better way. I understand it's based on destructuring; the syntax still just doesn't work for me.

Ocaml, StandardML, F#, Erlang, and Rust all use that syntax for pattern matching. What other syntax would you propose to test values in a JS object?

[deleted]

Re: What’s New in ES2019

#324

Earlier quoted context omitted.

Also see assignment expressions recently adopted in python 3.8: https://www.python.org/dev/peps/pep-0572/

In Python things are a bit different because declarations and assignments are ambiguous.

Also its addition to Python was controversial, to say the least. (I have been enjoying using it, however)

Re: What’s New in ES2019

#325
post #162
post #68

Earlier quoted context omitted.

Pattern matching is a really important feature but I strongly dislike that proposal because it feels like it introduces a bunch of single purpose syntax that's going to restrict the ability to evolve the language in future. It feels like it's an addon, not a holistic solution. I would much, much rather that type annotation syntax gets standardised first, because it is comparatively easy to build pattern matching when…

In JS, the pattern is the type. That is the point of duck typing.

> In JS, the pattern is the type.

How do you match against a `Buffer` pattern/type?

Re: What’s New in ES2019

#326

Earlier quoted context omitted.

There are tools like create-react-app that configure complicated build pipelines for you, and there's parcel, a simple common-case build pipeline.

Again, just for the sake of playing Devil's Advocate, the fact that we rely entirely upon such helpers (and the overwhelming number of mutually exclusive options available) is a potential indicator that we're making it more complex than we have to[1]. The syntactic sugar that we're adding to make our own jobs easier is arguably making things disproportionately more difficult for anyone who doesn't already have the sa…

The main complex task that's being addressed is making JavaScript that runs on a variety of browsers, not just the latest Firefox.

I'm afraid I don't know what you have in mind as far as syntactic sugar that makes things harder for learners. Every new syntax I can think of makes JS easier to learn and use.

Re: What’s New in ES2019

#327

Earlier quoted context omitted.

I dig it too, but you could previously flatten an array with concat, and the spread operator. [].concat(...array) Lodash wasn't necessary.

Heh, didn't know that. Thanks for the tip :)

Don't do that, it won't work for arrays greater than a certain size

Re: What’s New in ES2019

#328

Honest question, not meant to be inflammatory. If we still need to target es5 4 years later, and transpilation is standard practice, why bother? Is the evolution of JS not directed in practice by the authors of Babel and Typescript? If no one can confidently ship this stuff for years after, what’s the incentive to even bother thinking about what is official vs a Babel supported proposal. I like the idea of idiomatic…

> If we still need to target es5 4 years later, and transpilation is standard practice, why bother? Is the evolution of JS not directed in practice by the authors of Babel and Typescript? If no one can confidently ship this stuff for years after, what’s the incentive to even bother thinking about what is official vs a Babel supported proposal. For one, not everyone works on the client. I can write for Node and use ev…

> I can write for Node and use everything v8 supports without ever touching Babel and Typescript.

You totally can do that--but you probably shouldn't, because writing TypeScript is better for you and for future you. ;)

Re: What’s New in ES2019

#329

Honest question, not meant to be inflammatory. If we still need to target es5 4 years later, and transpilation is standard practice, why bother? Is the evolution of JS not directed in practice by the authors of Babel and Typescript? If no one can confidently ship this stuff for years after, what’s the incentive to even bother thinking about what is official vs a Babel supported proposal. I like the idea of idiomatic…

One place this works, when your clients are able and willing to use the latest browsers to use your software.

The primary benefit is that I don't have to rely on hacks.

This is how I build the backend to my CMS and my clients are happy to keep their browsers updated. (nearly trivial to do these days).

This also means that as soon as I see a new JS/CSS feature that will eventually become mainstream, I can use it in my admin as soon as both major browsers (Firefox/Chrome) support it. And even sooner if it's not a critical feature. (eg, I can skip adding a feature like "lazy loading" because browsers will have it built in eventually, etc...)

On the public facing front end, that is a different story though. It's motivation to keep things simple.

Re: What’s New in ES2019

#330

Now if we could just get pattern matching[1] and optional chaining[2], that would really elevate things. [1] https://github.com/tc39/proposal-pattern-matching [2] https://github.com/tc39/proposal-optional-chaining

Waiting for Optional Chaining. It's in Stage 3 already.
Post reply on HN