I think the biggest advantage TypeScript gives is discoverability when using a language server driven development environment. Hover over a function and you’ll get its signature and doc string. This will work quite quickly due all of the type information pointing back to its definition. This kind of static analysis is impossible in a weakly typed language due to the fact a random variable could hold anything at runtime. In this case an IDE cannot help you much inside an unfamiliar code base.
At my workplace a team of test engineers wrote an entire little test framework around our application. It‘s using webdriver.io under the hood but defines all test classes in type script. Everytime I need to inspect a failing test I open it up in my Emacs and jump around the test method definitions quickly and easily and enjoy inline doc strings popping up wherever I set my cursor on. So the task of fixing a test becomes quite easy despite not having written the framework. Back when we used JS or Perl this task used to be quite obscure.
On the other hand when I see react applications written in typescript I become quite skeptical of the supposed architectural benefits of static typing in front end logic. While React applications were already difficult to grasp, static typing constraint make refactorings even more headachy and I receive Java‘s spring framework vibes constantly.
> I think the biggest advantage TypeScript gives is discoverability when using a language server driven development environment.
+1: I'm much slower working in environments where I have to do this manually. This is why I've been infiltrating Python type annotations in our codebase.
At my workplace a team of test engineers wrote an entire little test framework around our application. It‘s using webdriver.io under the hood but defines all test classes in type script. Everytime I need to inspect a failing test I open it up in my Emacs and jump around the test method definitions quickly and easily and enjoy inline doc strings popping up wherever I set my cursor on. So the task of fixing a test becomes quite easy despite not having written the framework. Back when we used JS or Perl this task used to be quite obscure.
On the other hand when I see react applications written in typescript I become quite skeptical of the supposed architectural benefits of static typing in front end logic. While React applications were already difficult to grasp, static typing constraint make refactorings even more headachy and I receive Java‘s spring framework vibes constantly.