3 ms·
I have been exposed to TS a bit, so this list may not be exhaustive, but to name a few that I use on a regular basis: - Consistent async API (incl. Future, Str
by isoos 10y ago
I have been exposed to TS a bit, so this list may not be exhaustive, but to name a few that I use on a regular basis:
- Consistent async API (incl. Future, Streams, async* for Streams, async/await support everywhere). async.js is nowhere near to this.
- Type inference and analyzer toolchain that works and don't need to fall back on grep. The moment you start using anything like lodash or similar you will lose your ability to explore the code reliably.
- Isolates and Zones as higher-level constructs for dealing with complex concurrency and parallelism constructs. Nothing comparable in the JS world.
- Cascade operator.
- 1 != "1" (have been burnt by JS several times, and TypeScript won't provide a break from it)
I hope to use soon:
- SIMD
- TomMarius 10y ago> - Consistent async API (incl. Future, Streams, async* for Streams, async/await support everywhere). async.js is nowhere near to this. There now are Promises and Promise-based async/await keywords. Sure, there are some legacy APIs, but this is no longer as true as it used to be. > - Type inference and analyzer toolchain that works and don't need to fall back on grep. The moment you start using anything like lodash or similar you will lose your ability to explore the code reliably. TypeScript has introduced mapped and lookup types in its latest version, that solves this problem.
- isoos 10y agoWe have a disagreement on the definition of "solves the problem". Having tried to refactor a codebase with heavy lodash use, that battle seems to be lost. Also, take a look at the async* construct here: https://www.dartlang.org/articles/language/beyond-async https://www.dartlang.org/articles/language/beyond-async Nothing similar is in TypeScript, and this is roughly a two-years old feature in Dart, not a fancy-new hype. I have used it couple of times, it is useful, and again: consistent across the board. Of course if you are happy with the limited promise support in TypeScript, go ahead with it. However saying that they are on-par is far from the truth.