Despite my long history in C#, I’m still not using TypeScript


Despite my long history in C#, I’m still not using TypeScript. Why?

I’ve found I don’t spend much time on type-related issues in JS.

¯\_(ツ)_/¯

“JavaScript fatigue is what happens when people use tools they don't need to solve problems they don't have.” - Lucas F Costa
That said, I totally appreciate how many projects/teams benefit from TS.

My need for types is reduced because:
1. My teams tend to compose many small apps instead of a few big apps
2. I work in React, where PropTypes help
3. ESLint catches many issues too
4. I typically declare a centralized mock data structure and code against that. This documents all object shapes and avoids repeating object creation code.
5. I write automated tests with Jest.
6. I heavily leverage npm packages, which often provide .ts files that @code parses.
7. I compile code with Babel which produces useful compile-time errors
8. I centralize React propType declarations and consistently declare object shapes with propTypes
9. I avoid mutating object shapes. I declare separate well-named objects when properties differ.
10. I centralize input normalization and normalize API call responses. This assures objects maintain consistent data structures and casing, and helps assure properties exist.
11. I strive to centralize state changes and enjoy immutable structures via Immer.

View original on X