DEV Community

Discussion on: The reasons I don't use Typescript

Collapse
borobudur01 profile image
borobudur01

"I'm not entirely sure why you hate TypeScript so much as all JavaScript is valid TypeScript",.. "The correct way is"..., "Can you provide me some code you had to tell TypeScript it was wrong"...
You really can't see the point of this article.

Collapse
jonosellier profile image
jonosellier

Addressing "You really can't see the point of this article":

I definitely can, he chooses to not use TypeScript and made some examples that seemed like a simple fix based on what he said. I'd go on and explain the reason why tonnes of people choose it over JS but we already know them. Whether or not he chooses to fully embrace typescript is fine but it comes down to a personal choice and like/dislike. Every issue he mentioned can be easily solved with more TS (Which he does not want to write, because personal choice), eg:

The issue where an optional prop was not being passed to the application but the application thought it existed: The fix? Slap a ? on optional props and use ?. to access them with some fallback. In JS the outcome would be the same (assuming babel) except they wouldn't have relied on the type checking to do their dirty work and they might have caught it earlier. Or they might not have... But it's not fair to say TS caused this when the object was improperly defined.

Addressing "The correct way is..." snark

"This hammer is useless"
I make this in jest, relax
If you're unaware of how you can elegantly solve an issue (trivially too, IMO) then the language will feel janky.

Addressing "Can you provide me some code you had to tell TypeScript it was wrong"

Genuine curiosity. I was expecting a language bug or some edge case I would keep an eye out for as a developer. It's just as important to know what something can't do well as it is to know what it can do well.