3 ms·
Tests and static typing are alternative solutions to the same problem. I think we're just going to have to admit that they both have strengths and weaknesses i
by j_baker 17y ago
Tests and static typing are alternative solutions to the same problem. I think we're just going to have to admit that they both have strengths and weaknesses in comparison to each other.
I say that static typing is like a game where you have to push square pegs into various holes that aren't square. You say that dynamic typing is like opening the flood gates on bugs.
Oddly enough, we're both right and both wrong at the same time.
- texel 17y agoThey don't solve the same problem though. All static typing does is make sure you don't have any type mismatches. Sure, it helps enforce assertions about your inputs and outputs, but there are a million ways your code can compile without issue and then proceed to fail spectacularly. The fact that, as this article states, tests are optional is another issue entirely, but it doesn't change the fact that static typing is only useful up to a point.
- j_baker 17y agoI don't know where you seem to be getting that I am for static typing. In fact, what you say about static typing only being useful up to a point is exactly what I was getting at. Neither way is perfect to remove bugs from your programs.
- texel 17y agoI don't think I made any assumptions about your feelings on static vs. dynamic typing, I'm just pointing out that even though on the surface they can be both used to solve similar superficial problems, static typing is woefully limited with regard to the scope of problems it can actually detect. Tests can go way farther to help verify the expected results of your code.
- j_baker 17y ago"Tests can go way farther to help verify the expected results of your code." This is definitely debatable, but I think we should agree to disagree at this point.