4 ms·
This reasoning makes no sense to me. It's like: Alice: "Doing X will prevent bugs like Y!" Bob: "Oh, but it does nothing for bugs like Z. I just won't bother
by amirmc 11y ago
This reasoning makes no sense to me. It's like:
Alice: "Doing X will prevent bugs like Y!"
Bob: "Oh, but it does nothing for bugs like Z. I just won't bother at all, then".
Why would you not want to try and remove an entire class of bugs if it were within your power to do so? Just look at all the effort companies like Facebook have poured into exactly this kind of problem with things like Hack and Flow (which make use of OCaml).
- glogla 11y agoI think you're missing each other in terms of what static typing you mean. Haskell or ML style static typing is very useful, completely changes the way you do things and gives you many guarantees. C or Java static typing is almost useless with regards to bugs (see null) and serves mostly to annoy you. It has many of extra costs of stronger static typing, but gives you very little of the benefits.
- taeric 11y agoStatic analysis is more than just static typing. Notably, it is possible to leverage static analysis for solid gains in reliability against code bases without having to rewrite them to take advantage of a different typing paradigm. To repeat, you can harden a code base without rewriting it by using static analysis tools. This is not as true with static typing.
- dllthomas 11y agoC static typing can be very useful, if you are able to use it effectively. There is, of course, a tremendous pile of things it doesn't do well, and a bunch of ways you can make it less useful for yourself, but the last C project I worked on I found it a tremendous help in refactoring compared to the nightmare I would have had without it.
- dschiptsov 11y agoNo one said that it doesn't catch different types of "easy" type-mismatch bugs (which dynamic but strong typed languages will catch too at the first test run) - Clang, for example, warns a lot, and there are industry-strench static analysers for C. Nevertheless complex code is usually buggy. Integer overflows is very good example of a bug by human programmers.