This doesn't make much sense if you want to avoid errors.
This doesn't make much sense if you want to avoid errors.
For example I don't see much about "classes" in MDN:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
https://developer.mozilla.org/en-US/docs/Web/API/Window/loca...
Seems like this documentation talks about little else than types to me?
This seems... factually incorrect? Shouldn't it say "a double"? (or a "number", which just means "double" in JS)
It might ignore any characters after a ".", but it's impossible to return an integer in JS...
radix: An integer between [...]
The Window.location read-only property returns a Location object
You gave supporting evidence for my point.
$foo = "hello, world!";
$foo = 12;
When you use a string-related function in Python, you expect the parameters to be strings, yet there's no type-safety enforced until runtime. let foo = "hello, world"
in let foo = 12
in foo
Whether bindings can be shadowed has nothing to do with whether typing is static or dynamic.The "lot of abstractions" is the distinction between type and class the article addresses, I guess?
I'd rather do the gymnastic and have the compiler tell me where I screw up right away. That's a tighter, more accurate feedback loop than a REPL. (Source: trying to implement a simple depth first search in both Lua and Ocaml.)
There's really two problems hidden in that that deserve to be considered:
(1) Static languages with insufficiently-expressive type systems may require more complex code (in terms of actual operations, not just type declarations) for the code to be valid when compared to dynamic languages (or static languages with sufficiently-expressive type systems.), and
(2) static languages may, depending on the situation and the completeness of their type inference system, require arcane incantations to the type system before it accepts that correct code is, in fact, correctly typed.
Some statically-typed languages are good on one or both of these measures, and so make less of one or both types of problems (Haskell, IMO, is pretty good on both, as static languages go, but lots of more popular static languages are really bad at one or both.)