Static type checking is the process of verifying the type safety of a program based on analysis of a program's text (source code). If a program passes a static type checker, then the program is guaranteed to satisfy some set of type safety properties for all possible inputs.
eliminates reduces bugs in your code
Flow's "Hello World"
Other installation methods — https://flowtype.org/en/docs/install/
Demo: hello-world.js via CLI
My favourite way to run Flow...
...is with Nuclide
Also by Facebook...
Hello World in Atom + Nuclide
Demo: hello-world.js & hello-world-typed.js
3rd party code
The benefits of Flow for me
- The syntax is fairly simple
- You can integrate it into one file of a huge legacy project
- It actually helps reduce bugs
- It integrates with most tools you already use (Babel, CLI, etc...)
- It’s self documenting
- Saves you pressing ⌘+R alot
- Leaves less to worry about when updating code down the line
When to use Flow?
- Larger projects
- When multiple people are touching the code
- You anticipate refactoring
- Code you may come back to after a period of time
Team benefits I’ve already seen
Amazing React support!
By Benjamin Reid