Hacker News new | past | comments | ask | show | jobs | submit login

What is there left to use in the end? Type annotations?

Maybe recommend not to use Typescript altogether then. Their only reasoning for this seems to be that the features "be more likely to break when using build tools other than the official TypeScript compiler".




Their reasoning is missing the forest for the trees. The point is that most TS features do not map easily to JS, making any interaction with the resulting code a pain. That includes any static analysis of the JS output (not all tools support TS, after all), debugging both with step by step and console logs, and monitoring in prod.

> What is there left to use in the end? Type annotations?

I've always used TS for the types and nothing more, and been happy with it. Seems to me that most of the JS community has come to adopt this approach over time, and I don't see what's bad about it.


Type annotations are the whole point of TypeScript. The rest is mostly distraction and historical decisions that made sense at the time but have aged poorly.


> What is there left to use in the end? Type annotations?

That's what Typescript mostly is, that's where its success comes from. Type annotations for existing JS code. The vast majority of people need to type existing JS code, and compile to JS. A few minority need some specifics from the TS type system. Outside of that, there are other options.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: