Hacker News new | ask | show | jobs
by harha_ 510 days ago
TypeScript is unnecessarily complex.
1 comments

Conveniently, it's entirely and discretely optional!

Or is there critical typing functionality that Typescript accommodates only perversely?

Sure, it is optional, but I've seen the unnecessary complexity seep into codebases over time, even though the software was originally elegant and simple.

I'm not sure if such perversions exist, it's been a while already since I touched TypeScript. To me the whole system seems perverted in the sense that an inexperienced developer can easily make things unnecessarily complex.

You are preaching to the choir. I have been using TypeScript for around 7 years, and it's great in a lot of ways, but unnecessary complexity is everywhere in the TS world. I regularly see elaborate type acrobatics that kneecap TSServer because of recursive types and complex inference. It would be fine if it was just hard to read/understand, but it can have profound negative DX consequences. I once encountered some complex types that were causing tsc to take over 5 minutes to run on a reasonably large codebase (~200K lines). Removing them dropped the type-checking time down to 2 minutes. I wish devs would stop worrying about making _everything_ type-safe and just write a few damn unit tests.