DEV Community

Discussion on: Why TypeScript is the better JavaScript

Collapse
 
wfreeth profile image
waynef

You don't mention the downsides of Typescript over pure JS. The transpiled code it produces has more run time checks so is generally slower.
We've seen some big performance gains by dropping Typescript in Lambda.

As most of the benefits can be gained using other tools (eslint, sonar cloud and just basic unit tests). The only real advantage is a slightly better IDE.

Collapse
 
bennycode profile image
Benny Code

Hey @wfreeth, thank you for your comment. Do you have performance benchmarks to share? TypeScript emits clean and idiomatic JavaScript code, as it is one of the language's primary design goals. Notably, features like "const assertions" don't emit additional runtime checks, which ensures that the resulting JavaScript code is not slower (see this video). Therefore, I'm curious to learn about the specific cases you encountered where performance was affected?