TypeScript vs. JavaScript
Ayo Alfonso

It was mentioned that static typed languages are faster; Static compilation is faster, but typescript is not statically compiled. It simply has static type checking at runtime and a static syntax that isn’t native— which is expensive in a dynamic language no matter how fancy the algorithms to implement it. Typescript is still transpiled to JavaScript for web apps today (unless it is on a custom platform or type checking is stripped from prod entirely and it’s converted back to JS — which it’s not), and so this is a misstatement for 95+% of our use cases as web devs.

There are pragmatic examples in widely used libraries as well: In React, propTypes when shipped with React would have no type checking simply to avoid huge performance costs; this is even considering that propTypes are overall a very lean and natural JS oriented way to declare type checking vs typescript.

I understand this is a smaller part of the overall premise and there’s a lot of merit to TS which are clearly pointed out here, but it was just something I thought should be corrected for the sake of misinformation among devs ~_~

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.