3 ms·
> Why is TypeScript so much worse than JavaScript? TypeScript is a superset of JavaScript and compiles to it Typescript produces garbage JS output that creates
by vorpalhex 4y ago
> Why is TypeScript so much worse than JavaScript? TypeScript is a superset of JavaScript and compiles to it
Typescript produces garbage JS output that creates all sorts of weird bugs, hiccups and strange quirks. It doesn't surprise me that TS generated JS would perform much worse than directly written JS.
- steveklabnik 4y agoEven if you take a JavaScript file and run it through tsc, it adds stuff? That is indeed surprising to me! It wouldn’t shock me that there were differences if you used a bunch of fancy TypeScript features, but at the limit I would expect no overhead if you don’t use any of them. Maybe that expectation is misguided.
- rcme 4y agoIt depends on your compiler settings but the code can very closely match equivalent JS if you want.