3 ms·
Most languages do some checks at runtime. This is the strong / weak typing dichotomy (which is different from the static/ dynamic one). For example, Java will
by xmcqdpt2 4y ago
Most languages do some checks at runtime. This is the strong / weak typing dichotomy (which is different from the static/ dynamic one).
For example, Java will throw an exception at runtime if an object is cast (using .asInstanceOf) to an incompatible class. Python throws if you add an integer to a string. Both of those languages are strongly typed.
On the other hand, C has no runtime checks whatsoever. If you add a number to an array the program will happily move the array pointer and maybe overflow, but even that won't cause a runtime failure every time.
- BerislavLopac 4y agoThis is precisely my point. In the examples above, the checks are implemented in specific cases, and not universally; so the whole point of static typing is the analysis, and not runtime safety.