News for hackers. Stuff that matters.
Re:A Modern JavaScript Tutorial by heavyset_go on Tuesday December 08, 2020 @12:33AM (#25342259)
I get CoffeeScript vibes from TypeScript, and look at where CoffeScript is now.
Re:A Modern JavaScript Tutorial by sanderjd on Tuesday December 08, 2020 @12:39AM (#25342288)
I don't get this. What do you mean by coffeescript vibes? They are super different languages...
Re:A Modern JavaScript Tutorial by heavyset_go on Tuesday December 08, 2020 @03:17AM (#25343076)
In that JavaScript only needs to adopt a few of its features for the benefits of welding yet another compiles-to-JS toolchain on to projects to dwindle in comparison to writing ES8+.
Re:A Modern JavaScript Tutorial by Vinnl on Tuesday December 08, 2020 @04:09AM (#25343327)
The difference between CoffeeScript and TypeScript was that CoffeeScript offered syntax that people preferred, whereas TypeScript provides write-time checking of errors. It is more similar to ESLint in that regard, and is better understood as a linter than as a separate language like CoffeeScript.

Even if TS's type annotations would be added to the language (like it practically almost has been, through Babel supporting it), you'd still want to run a tool as you write it to actually check that those annotations are adhered to, rather than having your code crash on the user when they are not. TypeScript is that tool.

Re:A Modern JavaScript Tutorial by z3t4 on Tuesday December 08, 2020 @04:49AM (#25343529)
Adding optional type annotations to JS would be interesting. It might help with VM optimization.
Re:A Modern JavaScript Tutorial by heavyset_go on Tuesday December 08, 2020 @03:02PM (#25350587)
Python already does type annotations, and I have no use for Mypy other than using it for type checking in my editors via LSP. I don't import it or use it as a dependency at all in projects.

I feel like JavaScript adopting type annotations in a similar manner will make TypeScript look the same as Mypy in many regards: nice to have, but not necessary most of the time because the parent language ships with most of its features.

Re:A Modern JavaScript Tutorial by azangru on Tuesday December 08, 2020 @06:54AM (#25344134)
> and look at where CoffeScript is now

Largely absorbed by modern javascript? ;-)

Re:A Modern JavaScript Tutorial by heavyset_go on Tuesday December 08, 2020 @02:58PM (#25350525)
If you look below, this is my point. It's inevitable for JavaScript to adopt most of TS' flagship features.