Parent's claim:
Of course, but not all tools are equal. In programming
languages, languages that have a static type system have
an insurmountable advantage of dynamically typed ones.
Your response:
javascript and python would disagree with you.
My question:
How so?
Since the claim is about the advantages of static type systems, I'll respond on that claim alone. The primary advantage of static type systems, particularly expressive ones, but even of less expressive ones like C, is that a large class of errors can never occur in run-time code. You cannot, possibly, without deliberate effort to defeat the type checker do the following in a statically typed language without at least a compile time warning (to permit C and its weak type system and occasional implicit casting):
Define a function in your language of type: int -> int -> int [or (int, int) -> int]. Pass in something that is not an int to either parameter.
Python will happily accept this code:
def add(a,b):
a + b
... some context
add("aoeu", 3)
And not tell you until that add call occurs. A run-time error. Could be very infrequent, which makes it really hard to reproduce.
In C:
int add(int a, int b) {
return a+b;
}
... some context
add("aoeu",3);
the add call won't even make it past the compiler.
JavaScript is even worse: You won't get an error at all!
function add(a,b) { return a + b; }
... some context
add("aoeu",3) // results in "aoeu3" as the return!
Dynamic
and weak typing!
This doesn't mean python and javascript are bad. But it does mean they possess disadvantages relative to statically typed languages. Their type systems mean that significant testing has to be put in to verify/validate your program for guarantees that are baked into statically typed languages (caveat for implicit conversions of certain types, again, in languages like C, but this usually gets at least a warning if not an error).