3 ms·
Personally, I find TypeScript to be a joy. I am a team of one right now, but at the last company I worked for, we migrated the codebase to TypeScript, and it w
by dgreensp 8y ago
Personally, I find TypeScript to be a joy. I am a team of one right now, but at the last company I worked for, we migrated the codebase to TypeScript, and it was a fair amount of work to migrate the existing code (especially since we had partially migrated to Flow), but worth it, IMO, to have the additional type information, especially given that it was a large shared codebase.
I've never seen such a powerful type system that's so easy to use. While the advanced stuff can be quite complex (as a consequence of its power), the experience of working with the compiler is made pleasant by good IDE support, fast type-checking, and readable syntax. Also, the level of type safety you want to go for is totally up to you.
The one frustrating thing can be using frameworks and libraries that don't have good type definition files. React and TypeScript are actually a slightly awkward fit, because React's component classes and idiomatic HOCs are quite difficult to type correctly, even though TypeScript has built-in React support. In my own code, I've ditched React's component classes for this reason.
- benjaminjackman 8y agoWhat are you using instead of React's component classes?