David Garcia
2 min readJun 10, 2024

--

I don't know how to tell you this in a polite way, but you have no idea of what you are talking about:

1. Never define a string variable that any other type can replace. Type Hinting is there for a reason, and that's why TS is better than JS. It's the primary reason for making JS popular: TS provides what JS doesn't provide natively.

2. TS is easier to read because it tells you all the time what type of data you have or should pass. Suppose your reasoning for defending JS is that you don't want to add Type Hinting because your line is shorter. In that case, it makes other (not yourself) devs waste hours understanding the logic, assuming there are no misunderstandings.

3. You are mentioning an inexperience problem. Types are there to ensure we can do what we are supposed to do. If you “need” the opposite, you can't work as part of a team, and your code is unmaintainable. Have you ever heard about “technical debt”? You’re welcome.

4. C and C++ (and now C#) are two (three) of the most essential languages. They are used for the most critical software (like your OS) and games because they ensure proper resource usage and stability. You mention a benefit of TS; not using it is a step back.

5. Using TS in frameworks is the only reason they are popular. If frameworks are using TS, it is for a reason. Don't call yourself a guru if you don't understand or disagree with this reasoning. Furthermore, I don't see a problem with using an interface to define a structure. That's one of the most common options in any language.

Please do yourself a favour and start learning the real reason for learning and using TS, be part of teams and communities and gather real-world experience.

Working on small utilities or personal projects where no other people or maintainers are involved is one thing: you make the code and maintain it.

TypeScript is there for the opposite cases: teamwork, stability, reliability, maintenance, performance, and compatibility.

TypeScript is the best thing that happened to JavaScript - and I dislike Microsoft, but I must admit that they did this the right way.

--

--

David Garcia
David Garcia

Written by David Garcia

Senior Software Engineer, Backend, NodeJS & Symfony developer, workaholic, passionate for new technologies and OSS contributor. https://linktr.ee/davidgarciacat

No responses yet