DEV Community

Discussion on: 10 reasons why you should use Typescript

joelbonetr profile image

I'm not joining this discussion anymore positioning myself in favour or against TS.

Just came to tell you as a Tech Lead on a big company that I never saw a bug in any environment from a project using JS related to any single thing that TS "come to solve". I've saw other stuff exploding, of course but none related to this. Mainly because those errors are prompted in dev time almost always.

In the other hand I saw few errors (luckily spotted by QA) related to the fake peace of mind that TS provides. Meaning that devs not checking its code to be valid for different types on a dynamic endpoint (content provider) and then getting weird behaviours on that.

TS is for DX (Developer experience) and we can agree or disagree, love or hate it, but at the end you need to know how the tech of your election is working behind the scenes, otherwise errors and bugs will show up sooner or later.

For me, every dev needs 2 things:

  • to get experience in testing your own features, keeping in mind all the possible use cases for your code and not only for the acceptance criteria of the task.
  • to understand the errors.

If you don't understand how the tech is working behind the scenes you'll not be able to interpret the errors properly, nor to spot all the use cases from your code and thus no magic tech will help you to became better.
Is TS the answer? Obviously not, it can help or harm depending on the situation and this requires in deep analysis from the current situation (the amount of devs available for the project, the current background of those devs, the requirements, the timeline with the deadlines and so on).
The tech lead (myself in my case) will decide according to this information if the project is suitable to be coded using TS or not.

There's no tech to rule them all, you need to analyse well what you need to do to find out the best possible tech stack and check if you have enough human resources with enough knowledge about this stack to go for it. This applies to any tech.

The conclusion is that if you are using TS like a mantra, you're probably missed the analysis part and thus you're probably wrong. Luckily people that act like this (tech fan boys) usually don't grow enough to burn other devs with it's own decisions.