Re:Runtime type information for JavaScript
by seanwilson on Monday September 18, 2017 @02:40AM
(#15273822)
> The motivation for dynamic checking was often because many JavaScript programs couldn't be given any useful static types.
I like this quote: “Dynamic typing: The belief that you can’t explain to a computer why your code works, but you can keep track of it all in your head.”
I don't get it personally, when you've got decent type inference the number of type annotations should be minimal and compile-time errors mean things that would cause a runtime crash anyway.
The motivation for dynamic checking was often because many JavaScript programs couldn't be given any useful static types. With the great work on Flow and TypeScript I'm starting to become convinced that we'll just be able to statically check most JavaScript programs in the future and get decent types out.