Hacker News new | ask | show | jobs
by jw- 3198 days ago
I've done some work on dynamic type checking for JavaScript and the tricky part is always when things start going higher order; sadly this is often omitted from examples.

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.

1 comments

> 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.