|
|
|
|
|
by Draiken
991 days ago
|
|
>if you use TypeScript in an object-oriented way I don't follow this one. I've never seen anyone use TypeScript with an OO approach aside from, ironically, the .NET folks. The code I wrote has nothing OO with it and we can already see the issues. The majority of TS I've ever worked with was written for React and it still would benefit greatly from nominal types as you call them (thanks I didn't know that terminology). I don't see everyone misusing TS. For me, it's simply a very limited language as far as typed languages go. As a result, it's a shame that it's what is being touted as a good example of why you should use typed languages. |
|
Then, if you have converted lots of Javascript into Typescript, you have probably found several type-related bugs.
On one hand, this makes you (me) trust Typescript more, and feel safer knowing that your types are correct.
Later, you discover that a few of the declared types are wrong! You also still get "this" wrong in callbacks.
You could say that Typescript lets you try to get your types right, but you have to do the heavy lifting yourself.