3 ms·
One could imagine that a type system is actually a set of tests confirming that a function will only accept arguments that are typed according to the function's
by twblalock 8y ago
One could imagine that a type system is actually a set of tests confirming that a function will only accept arguments that are typed according to the function's signature.
To confirm this in a dynamic language, one would need to pass every possible permutation of every type available to the language to the function under test, to confirm that a function of, say, (string, int, boolean) would only ever work in the expected manner if the first argument was a string, the second was an int, and the third was a boolean.
Have you tried passing every possible permutation of typed arguments to your functions in test cases? If you haven't, then your program is less tested than a similar program written in a typed language. In a typed language you get all of that for free.