DEV Community

Discussion on: Validate javascript data type in runtime? Yes, Hello Type.

frustigor profile image
frustigor Author

for the first point. I do not think flow will help you to check data type during run time, in fact, the checking is done by your own code logic, not by flow static system.

And in my opinion, Flow or Typescript make a way to access static data type, but weaken js flexibility, and make project code library bigger and bigger. It is for a big project with different level of developers, not for small projects or which developed by experienced developers.

Thread Thread
stereobooster profile image
stereobooster

Checkout my post about IO validation, it shows how to make a bridge between static types (Flow or TypeScript) and runtime type checking.

If you wonder why one need types, read my post on how types help to prevent bugs here