3 ms·
In terms of Javascript targeting languages, Typescript has been the only one that hasn't made me want to murder a thousand baby seals. The build system is fast
by saosebastiao 11y ago
In terms of Javascript targeting languages, Typescript has been the only one that hasn't made me want to murder a thousand baby seals. The build system is fast and easily understood, the typing makes refactoring so much easier, and in probably its biggest win, I can read a Javascript tutorial and trivially write the same thing in Typescript.
As a language, though, it still leaves a lot to be desired. Things like type guards and null annotations are like the methadone to the vastly more addictive pattern matching and options that I can no longer live without, and promises/callbacks are vastly inferior to futures. I would rather use Scala.js or Elm, but the ecosystems pale in comparison and trying to work in what is effectively an abstraction layer (and leaky at that) makes life really difficult. So I stick with Typescript.
- woah 11y agoHave you tried a async/await?
- softawre 11y agoasync/await isn't in TypeScript yet, if that's what you were implying. It will be though (and obviously is part of babel if you choose the right pieces).
- billti 11y agoasync/await has been in TypeScript for a while, but currently depend on generators, so don't down-level to <= ES5 emit (that work is in progress). With the latest Node releases and modern browsers supporting generators today, you can target ES6 and use async/await today if you can target those environments. https://blogs.msdn.microsoft.com/typescript/2015/11/03/what-about-asyncawait/ https://blogs.msdn.microsoft.com/typescript/2015/11/03/what-...