So why didn’t I use it more? Are there any reason not to use TypeScript?
Not wanting to add in another language and complicate things
So, adding in another language actually makes things easier. Counterintuitive perhaps but true.
Can’t be bothered setting it up
It does seem like a faff to set up TypeScript particularly if you are starting off and have just set up Node, SASS, Jest and React and now you’ve got something else to set up. You might just run out of patience. But if you are using create-react-app then it’s a simple matter of an additional flag
npx create-react-app MyApp –template typescript
Node isn’t too much harder. To be fair if you are using Angular then it’s a bit more fiddly, but you only need to do it once so it shouldn’t be a massive deterrent.
TypeScript also has its freedoms. Freedom from type mismatch errors, freedom from code breaking comparisons and freedom from method name typo bugs. Perhaps it even gives freedom from those application crippling issues that are only discovered late on a Friday afternoon. That’s the kind of freedom I prefer.
When I started programming, I taught myself C. I almost never have used C professionally and I never ever have got a job based on my C expertise. But I am grateful that I started out that way. It hammered home basic principles such as memory allocation, references, and arrays. I still sometime think about pointers when coding in completely unrelated languages.
Writing demo code and want to keep it simple
You are told not to use it
Sadly, we are not masters of our own code. If you are a professional programmer then you need to comply with your employers’ technologies, languages, and standards.