Flow : It’s Not Just About Static Typing

Harsh Vardhan
Aug 26, 2017 · 2 min read

Flow has become a well known type checker in the Javascript ecosystem but it’s advantages aren’t limited to type safety.

It Helps Others Understand Your Code

hover and see the type definition

The ability to simply hover over states and know the structure of the state improves maintainability and readability.

It Prevents You From Creating Overly Generic Functions

Developers at time can be prone to over engineering which can mean creating abstraction by bringing over complex reusability.

Here a generic function saveData() has been created where its accepting property of type name and age accompanied with the data.

But now if I have to statically type this over — engineering is no more possible. Variable data can either be only of type number for saveAge() or only of type string for saveName().

)
Harsh Vardhan

Written by

React Developer & Consultant trakbit.com

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade