DEV Community

Discussion on: 4 Ideas of how to harness the power of Typescript generic function

Collapse
 
glebirovich profile image
Gleb Irovich

When I started with TS, it was a React project, so I was not convinced at all, especially given the good old PropTypes lib for checking react props.
However now typescript is my tool of choice and I think it’s not fair to compare what you can or cannot do with JS instead. You can do anything without TS and with TS you can only go as fas as JS would allow.
Here are the main selling points of TS from my point of view:

  • powerful refactoring tools
  • great assistance while writing the code
  • I like a blueprint - first approach, which encourages to think about your data and then writing actual code
  • self-documented code. No comments needed when you can read types and function signatures