Earlier quoted context omitted.
Yes. I've read some of the reasoning behind choosing the syntax. Regardless of the issues, I think going with the current proposed syntax is a terrible mistake.
Me too, in fact it is the only thing I dislike about the upcoming language features.
What's New in JavaScript for 2019
81–85 of 85 posts
Re: What's New in JavaScript for 2019
#82Earlier quoted context omitted.
In my uneducated opinion, I think this is the direction things will go. Typescript will steadily supplant JavaScript and browsers will eventually roll out native support for it, and JS will be relegated to a legacy language.
>Typescript will steadily supplant JavaScript and browsers will eventually roll out native support for it, and JS will be relegated to a legacy language. Typescript can't supplant javascript or relegate it to a legacy language... because typescript doesn't compile to bytecode or machine language, but to javascript. Browsers that support typescript natively must by definition also support javascript natively, and the…
Re: What's New in JavaScript for 2019
#83Earlier quoted context omitted.
Here's the FAQ on the private syntax: https://github.com/tc39/proposal-class-fields/blob/master/PR...
Ok reading that I'm going to amend my suggestion above. class fish { color = "blue"; // color is now a name in scope for this class definition #agenda = "Total World Domination" // agenda is now a name in scope for this class definition ... reveal () { console.log("I am a " + color + " Fish " // interpreted as this.color +"seeking " + agenda // interpreted as this.#agenda; } } You can still have this.agenda for publi…
class fish {
color = "blue";
private agenda = "World Peace"
constructor(){
color="red"
agenda="Secret World Domination"
}
reveal () {
console.log(`I am a ${color} Fish seeking ${agenda}`)
}
}Re: What's New in JavaScript for 2019
#84At this point, it looks like they might as well import the Java syntax and call it "JavaScript fusion" and be done with it.
Re: What's New in JavaScript for 2019
#85Earlier 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…
None of those are mandatory. They're mostly just syntactic sugar on top of existing features.
Every other change has just been things like new util methods on primitives like the string trim functions.
The build tools are separate, don't conflate them with the language. That being said, for ~4 years, most people's build chain hasn't changed; webpack with a babel plugin.
The problem is that JavaScript wasn't considered a stable and useful language until it really started to hit its stride in about 2009. So all of the changes that have happened are because the community is still figuring out the best way to do builds whilst things in the language are still changing.