|
|
|
|
|
by hajile
1100 days ago
|
|
Typescript's devs define it as simply JS with types to the point that they even have a proposal to add those type constructs into JS at which point the syntactic difference would be very small indeed. > Things like enums, Generics, sum types, product types, recursive types, really change the game by restricting what functions can do. If only that were true. The reality is that if you can write it in JS, you can add TS types no matter how horrible or anti-pattern the code happens to be. The constructs you mention don't restrict what functions can do in any way at all. > A programmer without experience in types (ie plain JS) won't be able to pick up types that that quickly on average. The average JS dev seems to have a Java/C# background where types exist. Further, they seem bent on slowly transforming JS into one of those languages. |
|