Javascript the language is getting much better, and is quite nice in many dimensions. Javascript the ecosystem has a lot of strengths, while also having embarrassingly poor base libraries that require stupid levels of duplicated effort and a platform that is still painfully inconsistent. The fragmentation around Coffescript/Typescript and linters hints at a much stronger need for a language that does more than JS does at its core... As traditional languages encroach into the browser space I see a lot of the "SPA" and cutting edge fat-client-in-html moving away from JS because of those warts.
The point the author is making is that the haters love to point at these quirks and claim that they cause "untold pain"; yet in actual practice I've only been bitten by == maybe twice in 15 years.
This argument applies equally well to using PHP for most anything. Not impressive.
> You may have noticed that the code above isn’t even JavaScript, it’s TypeScript, which brings me to my next point.
Which kind of invalidates the entire premise of the article.
Removing the cast means removing static typing. It might be a small change for this snippet, but at the project level, you'd need considerably more changes, and you'd lose type safety.
It has almost no new "features" (apart from enums and namespaces, I think) and only contains a typing + visibility system and related syntax on top.
The only part that is not ES2015 in the given code example is the ' as ConsignmentSetup' cast.
I agree with the other posters - there are probably good defences of JavaScript that can be written, but writing an article about how great JavaScript is and then showing a code sample from a different language just reinforces the idea that JavaScript developers probably don't have much experience with other kinds of programming.
You could say that about C++ and C, but that's an entire different can of worms.
So why not give the example in JavaScript then? Arguing that JavaScript is "Good, Actually" and then showing examples of tools people have build to avoid using vanilla js because it lacks X or Y is actually an argument for js being "Not Good Enough".
http://node.green/#ES2017-features-async-functions
I had to look it up because i could've sworn async functions were es2015. The lines get blurry when things are implemented out of order.
{Garbage code example} "Syntax is just syntax". "Tool writers are neutral, then get to work fixing this terrible language".
Really?