|
|
|
Ask HN: Why do people hate TypeScript?
|
|
3 points
by lackita
477 days ago
|
|
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. |
|
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.