DEV Community

Discussion on: This is why I hate Typescript

Collapse
 
cdecompilador profile image
cdecompilador

I understand the point, I came to Typescript from languages like c, c++ and rust just because of the strongly typed system, but I encountered many bad thing on it, generics are horribly bad implemented (the compiler does not infer the generic if there are too many indirections), the language lacks many functional features that reinforces your point, made by OO programmers to OO programmers, it would be great to have algebraic data types, unions, a better generic system (or use templates/traits). But still the idea is great in my opinion, an option that is done better in my opinion is haxe (compiling to javascript) but still not very popular.

Collapse
 
michaeljota profile image
Michael De Abreu

This are actually the best valid points to "hate" TS. The inferences could work better, and I know they are working hard to make them work better without having to sacrifice performance. I understand that the main goal of TS is to balance between correctness and performance, but it still need some work in that. Recent versions of TS shown better understanding and better syntax to use generic, and there is even a couple of proposals to declare named generics, and to infer other generics members.