Live data from Hacker News

What's New in JavaScript for 2019

developer.okta.com

51–60 of 85 posts

Re: What's New in JavaScript for 2019

#51

I might get heat for this but personally I find the JavaScript ecosystem to be a mess. There are so many changes to the language that are done aggressively which I think are done without much thought. For example, the promises API, now we also have async/await. The module system, with require(s), then import/export, and there's browser JS and system JS (node), and npm and now yarn, then your build system, with webpac…

It’s fine if you are a fairly experienced JavaScript developer, and understand the tools that you used to have, and what their pain points were, and what solutions are coming along the way; then you just go with the flow and enjoy the progress.

I can understand the frustration of people who don’t touch JavaScript on a daily basis, or confusion of newcomers. I can sympathize. But I don’t think that personal inexperience should reflect negatively on the language.

Re: What's New in JavaScript for 2019

#52
post #44

Earlier quoted context omitted.

> I might get heat for this but... Some variant of this is the top-voted comment of every HN thread on modern JavaScript. > For example, the promises API, now we also have async/await. The module system, with require(s), then import/export, and there's browser JS and system JS (node), and npm and now yarn, then your build system, with webpacker, browserify, bower. Async/Await are essentially sugar on top of Promises…

> All of this happened 3-4 years ago, if it's your job it's not hard to keep up. If it isn't your job there's plenty of guides out there to get you up to speed. I wouldn't expect to be able to jump back into Android dev after 5+ years away from it without doing some reading, I don't know why people expect web development to be so static. The thing is that the JavaScript language is so aggressively changed, unlike Rub…

> Not sure why JavaScript can't do the same?

We should be celebrating the fact that JavaScript finally has a sane module system after 20+ years, not complaining about it. Ruby had namespaces and modules from day one.

Re: What's New in JavaScript for 2019

#53
post #34

At this point why not just have browsers run TypeScript natively? Remember the , maybe just put and be done with it.

Because it's a slippery slope that you can never get agreement on (even majority agreement on, let alone overwhelming agreement). Why TypeScript? Why not Flow, or even Python or ClojureScript, or (my vote...) PureScript?

Then what happens in 2 years when the "next big thing" comes out that is mind-boggling-ly awesome and obviously obsoletes TypeScript? The latest addition to JavaScript is Array.flat... it should be called Array.flatten, but there was a popular third-party library 15 years ago that used it and you can't go breaking the web every time there's a new "best way" to do things.

Each fan of each language will happily tell you why theirs is better than any others, and why it's the obvious choice to be the default in a browser. Everyone might agree they don't want JavaScript, but no one will ever agree on what should replace it. That's why your two options will only ever be "JavaScript" or "transformed/WebAssembly-fied other language".

Re: What's New in JavaScript for 2019

#54
post #8
post #3

Earlier quoted context omitted.

Why?

Not the OP, but so much about javascript rubs me the wrong way. 1) Mandatory javascript is making the internet a hostile place. Basically every site you visit asks you to run untrusted code to view it now. What could possibly go wrong? 2) It's a hastily thrown together language that was rushed out the door by a Netscape engineer long ago, and it shows. 3) The 'ecosystem' is like swamp right now, at least to me. Frame…

> Basically every site you visit asks you to run untrusted code to view it now.

Javascript didn't do that. The needs for ads and analytics are doing that. You know what people used before Javascript? Flash and Java. You want untrusted code running on your system, you're going to get very much untrusted code running on your system.

The current situation is a huge improvement over that. No, Javascript isn't making the internet hostile; it's making it useful. Unfortunately, ads are making the internet hostile … but they're also making it profitable, thus… useful. YMMV. People are working on alternatives, it's not an easy problem to solve.

> It's a hastily thrown together language that was rushed out the door by a Netscape engineer long ago, and it shows.

Ok, we're beyond that now. Would the web be better had we had Lua from the get go? Maybe. It'd also be 1-indexed. Would it be better had we had Python? Well, we'd be stuck with shitty lambdas. You know, Javascript is an ok shell for a language that has received a lot of work since.

There is no programming language on earth that can compete with the amount of effort thrown into improving Javascript, ever since that "Netscape engineer rushed it out of the door".

> The 'ecosystem' is like swamp right now, at least to me

It's not. Again, 15 years of Python speaking here. Javascript's ecosystem is active, but the most popular frameworks and solutions are years old. Typescript is from 2012, React from 2013. Both have rock-solid APIs and backwards compatibility. Other popular frameworks also take this stuff very seriously. And the older "progressive enhancement oriented" frameworks such as jQuery are over a decade old and your 2007 code still most likely works with them.

The JS ecosystem is what you get when you lower the barrier of entry to an extreme. There's a lot of crap in it, but you're supposed to do your due-diligence with any dependency, not just in that one language. When I pull in a new library in Python, I look at its codebase first: Is it clean? Maintained? Tested? Popular? You should do the same with JS dependencies as well, you just get more choice; more chances for your problem to already be solved.

Re: What's New in JavaScript for 2019

#56

I might get heat for this but personally I find the JavaScript ecosystem to be a mess. There are so many changes to the language that are done aggressively which I think are done without much thought. For example, the promises API, now we also have async/await. The module system, with require(s), then import/export, and there's browser JS and system JS (node), and npm and now yarn, then your build system, with webpac…

I don't disagree that it's moving fast, but my experience is that the thriving ecosystem makes JS apps nice to work on.

Every project has its own little tech stack, each part being filled a-la-carte by some JS framework/library/preprocessor. The server might use express or raw node or Koa, the web client might use React or Angular, styles might be done with SCSS or styled-components, etc. JavaScript might have a different syntax between projects if they're using typescript/babel. There are lots of choices to fit many needs and preferences, and that's a good thing™.

All of these technologies are built around the same language and syntax, which at its core is relatively simple to learn (aside from the occasional type coercion/prototypal inheritance weirdness). This makes learning new frameworks and tooling easy: does it need a config file? Chances are it's a raw .js or .json file with a similar format to webpack.config.js or package.json or .eslintrc.

It's not a huge ask, nor would it be terribly difficult, for one developer to become competent with both Angular and React, for example. And once you've made your choices for your project and installed all the npm packages you need, there's no need to keep all of them updated to the very latest, bleeding-edge releases at all times. Just install patch (0.0.x) updates and wait for npm to warn you about any security issues in your existing packages.

That's why I'm kind of surprised to see so many companies advertising JS jobs with requirements like "Must have 3 years experience with React." Any competent Angular developer should be able to pick up React and start being useful in a matter of weeks, not months or years. Just hire JavaScript Developers, IMO.

Re: What's New in JavaScript for 2019

#57
> Why not use private.x to refer to a private field of this, and private(that).x to refer to a private field of another object?

I don't find the answer to this [1] to be particularly compelling. This actually seems like the right solution to me.

[1] https://github.com/tc39/proposal-class-fields/blob/master/PR...

Re: What's New in JavaScript for 2019

#58
post #34

At this point why not just have browsers run TypeScript natively? Remember the , maybe just put and be done with it.

Because it's a slippery slope that you can never get agreement on (even majority agreement on, let alone overwhelming agreement). Why TypeScript? Why not Flow, or even Python or ClojureScript, or (my vote...) PureScript? Then what happens in 2 years when the "next big thing" comes out that is mind-boggling-ly awesome and obviously obsoletes TypeScript? The latest addition to JavaScript is Array.flat... it should be c…

Good example, imho better to stop adding stuff to JS, declare it legacy and leave support in browsers so old pages render fine. Then add a new language without compromises like `flat` or `includes`.

Re: What's New in JavaScript for 2019

#59
post #58

Earlier quoted context omitted.

Because it's a slippery slope that you can never get agreement on (even majority agreement on, let alone overwhelming agreement). Why TypeScript? Why not Flow, or even Python or ClojureScript, or (my vote...) PureScript? Then what happens in 2 years when the "next big thing" comes out that is mind-boggling-ly awesome and obviously obsoletes TypeScript? The latest addition to JavaScript is Array.flat... it should be c…

Good example, imho better to stop adding stuff to JS, declare it legacy and leave support in browsers so old pages render fine. Then add a new language without compromises like `flat` or `includes`.

[deleted]

Re: What's New in JavaScript for 2019

#60
post #44

Earlier quoted context omitted.

> I might get heat for this but... Some variant of this is the top-voted comment of every HN thread on modern JavaScript. > For example, the promises API, now we also have async/await. The module system, with require(s), then import/export, and there's browser JS and system JS (node), and npm and now yarn, then your build system, with webpacker, browserify, bower. Async/Await are essentially sugar on top of Promises…

> All of this happened 3-4 years ago, if it's your job it's not hard to keep up. If it isn't your job there's plenty of guides out there to get you up to speed. I wouldn't expect to be able to jump back into Android dev after 5+ years away from it without doing some reading, I don't know why people expect web development to be so static. The thing is that the JavaScript language is so aggressively changed, unlike Rub…

You can use the old JavaScript if you want to. All those fancy tools just compile down to the same old es5 you can write by hand if you're so inclined.
Post reply on HN