|
|
|
|
|
by wexomania
1933 days ago
|
|
I keep looking for redeeming values in typescript but i keep getting disappointed.
Typescript fundamentally fails at its one main mission;
to make JavaScript typed, and in doing so, introduces issues much bigger than the "issues" it is trying to solve. (the fact that JavaScript is not strictly typed is not an issue, its a feature, although it also has its drawbacks) Firstly, the simplest problem to fix with typescript would be to remove the "any" type, with that in the language, it lets lazy developers be lazy and negates the fact that you have typing in the first place. Secondly, and this is the difficult one to solve, the types can lie to you.
Typescript would need to implement a runtime checking system, and i dont see how that can be done without significantly hampering performance and bundle size.
I know you can do type guarding and the likes, but you can do that in regular JavaScript as well. |
|
I remember when TypeScript was first introduced. 'any' is what allowed it to become the player it is today, because you could use the entire JS ecosystem with very little rework. If you'd of had to redevelop everything up the stack to primitive types it never would have gotten traction.
How is this any different from strongly typed languages that ultimately resolve to 'object'?
Your arguments sound a lot like letting better be the enemy of perfect. TS doesn't have to have runtime type checking (I'd argue it should not) to be a huge productivity gain.