HACKER Q&A
📣 lackita

Why do people hate TypeScript?


Bringing type safety to Javascript seems like a noble goal, but it seems like Typescript has been really polarizing. I can't figure out why and wanted to hear what people thought.


  👤 armchairhacker Accepted Answer ✓
TypeScript is much better than JavaScript. I think it's a great language.

My main issues with it, in order of priority, are:

1. The types aren't checked. In theory this wouldn't matter if the type system was sound and package type declarations were always correct, but neither of those are true in practice (even with strict mode and only popular packages), and I see runtime mismatches often enough that it bothers me.

2. I prefer nominal typing, and JavaScript's classes are verbose and usually considered not idiomatic.

3. Not a language issue, but npm packages tend to be worse quality (buggier, less documented, less intuitive) than other ecosystems (cargo and maven).

I prefer strongly-typed languages like Rust or Java. But I'd always develop a project targeting the web in TypeScript and be happy with it.


👤 Rzor
That would be quite a surprise for me, if it's true. All I've read over the years is that TypeScript made JavaScript significantly saner and more pleasant to work with (and that was my experience too). Maybe you got the impression from the reactions to the TypeScript types can run DOOM video?

👤 beardyw
I suspect the people who hate typescript are people who don't want to be told they ought to be using it. I have used very many languages and I have no particular love for any of them. They are tools to do a job. Love and hate (in this context) are a waste of time.

👤 anonzzzies
Where you see the hate? I think the entire ecosystem is a hellscape of rot, but typescript itself as a language is not the problem; much easier to build large projects than with js.

👤 dtgm92
I dislike when JS/TS is used for non-browser stuff, but there is nothing wrong with either language.

👤 Trasmatta
Who hates TypeScript? I see way more love for it than hate.

👤 pestatije
its not...you got the wrong impression