DEV Community

Discussion on: Typing and code flow in TypeScript and ReasonML

Collapse
 
olvnikon profile image
Vladimir

I've been working a lot with typescript recently and I would say it is pretty bad comparing to its analogues. It forces to focus on writing complex types instead of inferring. It doesn't feel javascript. It is not a sound type system. It doesn't guarantee type safety. Flow is pretty good in inferring types. Reason is amazing in this and gives you 100% static type coverage. While I was working with Flow or Reason I was focused on coding rather than on calculating types. For me typescript is a huge mistake. Why to use such a system that is not really connected to the language still requiring to write a lot types and utilities while it doesn't provide type safety?

Collapse
 
yawaramin profile image
Yawar Amin

I also feel that TypeScript has a lot of footguns that can lead to bad coding practices, e.g. I recently came across typescriptlang.org/docs/handbook/u... which can construct a new type by picking out some properties of an existing type. I believe this can lead to strong coupling and dependency cycles between different layers of a program. You're right about soundness and type safety, I really feel those are the number one priority of a type system to get correct.