3 ms·
With static typing the computer doesn't "understand" your code. It just automatically checks the correctness proof you've presented to it. And the correctness i
by sesm 10y ago
With static typing the computer doesn't "understand" your code. It just automatically checks the correctness proof you've presented to it. And the correctness is limited only to certain properties of the program, that a given type system supports.
- hacker_9 10y agoWe can argue about the definition of 'understand' all day, but it's a simple fact that the computer has more of an understanding of the structure of your program with a type system, and thus can help out more.
- bb88 10y agoI still wouldn't use 'understanding' in that context. It makes as if a static typing compiler sounds "magical". I could say "python is better at understanding what the programmer wants to do". But I think you'd disagree with me. The compiler is doing lexical analysis of the program being fed into it. That's it.
- dwc 10y ago> And the correctness is limited only to certain properties of the program, that a given type system supports. In case there are readers not familiar with the current state of things, you can pick solid languages today whose type systems support a LOT. It is completely fair (and good) to point out that this isn't a panacea, but it can significantly help.
- marcosdumay 10y agoIf you really think types are only useful for verifying code correctness, you probably never used a language with a modern type system.