3 ms·
It's definitely most useful when combined with type annotations. They're complementary tools, annotations can ensure type safety at compile time, but type safet
by phpnode 10y ago
It's definitely most useful when combined with type annotations. They're complementary tools, annotations can ensure type safety at compile time, but type safety is only one part of program correctness, whereas contracts can validate just about any aspect of program operation because they have access to all of the runtime information. They're like unit tests that run all the time (until you strip them in production at least).
This thing can be used alongside Flow[0] and other babel plugins which use flow syntax.
[0] https://flowtype.org/ https://flowtype.org/