What is the benefit of adding static typing to an inherently dynamically typed language?
As I understand, they don't get any performance improvement from that, as the browser still runs it in JS vm?
What is the benefit of adding static typing to an inherently dynamically typed language?
As I understand, they don't get any performance improvement from that, as the browser still runs it in JS vm?
If anything, I think most typed languages don't go far enough in making assumptions about their data explicit, and there is far too much primitive obsession. In an ideal world, I would not have to ever refer to documentation to understand what subset of inputs from the type that is declared on a function parameter are actually valid - a function that only handles integers from 0 to 100 would raise a compiler error if I tried to pass it 200, and whole classes of runtime errors would become impossible, and vast swathes of trivial unit testing harnesses would be irrelevant.