|
|
|
|
|
by curtisf
1460 days ago
|
|
No, TypeScript has these type system features because they are necessary to accurately type the programs people actually write using JavaScript. This isn't because of the shortcomings of JavaScript, it's because of the shortcomings of simple type systems. Simple type systems (like those of Java or Go) restrict the kinds of programs you can easily write while satisfying the type checker. Normally, the alternative is resorting to languages without static type checkers, like JavaScript. TypeScript allows mostly idiomatic JavaScript even with complex runtime invariants to be given quite accurate types at compile time. It has features I miss all the time in Java. |
|