Great article. I agree. I remember distinctly that years ago, JavaScript’s lack of a build step was advertised as one of its best features over other languages at the time. Yet somewhere along the way, this advantage became completely ignored.
Unfortunately Typescript doesn’t solve the most challenging aspects of software development today. It doesn’t mitigate the potential for unexpected state mutations, it doesn’t add anything in terms of error/exception handling and it doesn’t even remove the need for explicit schema validation of user-generated input data. The kinds of problems that it solves are the kinds of problems which mostly junior developers grapple with; like typos and mixing values of different types. These problems are trivial for a senior developer to identify and resolve. Especially if the code is tested properly.
Now, when it comes to the downsides of Typescript, based on current implementation, there are many. The build step can take time in large projects and this tends to break one’s train of thought. It adds unnecessary bloat and dependencies to the project which forces you to create large monolithic bundles that waste bandwidth and create caching and reusability challenges. It makes it harder to debug code because the code that you’re running isn’t the same as the code you wrote; line numbers don’t match; this makes it challenging to monitor issues in production and to reproduce them. Using TS means that you have to think about one more tool version number and you have to make sure that it plays nicely with all supported version of your underlying JS engine... Some TS config properties can be deprecated or not yet available depending on the TS version... I could go on and on about all the challenges which TS introduces.
That said, I recognize that TypeScript can add value to projects where there are a lot of junior and mid-level developers and where project planning and management is lacking. I just don’t think we’re doomed to always having bad management. TypeScript can’t serve as a substitute for excellence… Without a team that aspires towards excellence, at best, TypeScript can lift the code-base up to the level just above mediocre.