3 ms·
> The benefits of static typing (complie-time checks) are grossly exaggerated. If the claims were true, Java itself and Java projects would be much less buggy.)
by raz32dust 11y ago
> The benefits of static typing (complie-time checks) are grossly exaggerated. If the claims were true, Java itself and Java projects would be much less buggy.)
I have no stats here (and neither do you :)), but based on my experience, Java code does tend to be much less buggy when compared with dynamic-typed code, keeping the features and quality of developers the same. Of course, logical bugs don't get caught by static typing. But it helps a lot when refactoring code, or collaborating on the same codebase with many people, or changing someone else's code. These things become really important once the code base hits a certain size.
- crdoconnor 11y ago>Java code does tend to be much less buggy when compared with dynamic-typed code I only see this happen when both the Java code and the dynamically typed code both have zero tests. IME, once you actually start taking integration testing seriously and actually exercise your code even just a little, the benefits of static typing evaporate pretty quickly.
- raz32dust 11y agoThen you indirectly agree that java code requires less tests, which means static typing helps!
- crdoconnor 11y agoNope. The same tests you'd need anyhow to catch logic errors will end up catching type errors. If a test becomes unnecessary if you have static typing then you should never have written it in the first place. It's a bad test.
- dllthomas 11y ago"If a test becomes unnecessary if you have static typing then you should never have written it in the first place. It's a bad test." That seems a very strong - and unsupported - claim. Could you elaborate?