Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
Bromskloss
· 10y ago · 0 comments
Is the reasoning that you then don't have to test what happens if you pass a parameter of the wrong type to a function?
Comments
[–]
bbcbasic
10y ago
The compiler guarantees it won't happen. Such a test would be a test of the compiler and in my opinion unnecessary. And in Haskell at least... impossible. You can't write the the test because IT won't compile!
[–]
Bromskloss
OP
10y ago
I understand that. My question is if that is the kind of tests that people have in mind when they say that static typing requires fewer tests.
[–]
bbcbasic
10y ago
I can't speak for anyone else but I believe so yes.
[–]
iends
10y ago
Yes. When writing JS you have to explicitly do a lot more validation.