3 ms·
A compiled language that links in those classes and methods at compile time does resolve this issue, but it's not related to types (and you have to wait on the
by jey 19y ago
A compiled language that links in those classes and methods at compile time does resolve this issue, but it's not related to types (and you have to wait on the bloody thing to compile every time you change one character in the file).
How is it not related to the compile-time name resolution and type checking? In a compiled typed language, you would get a compile or link error if the symbol is not found. I regularly write and refactor C++ by inducing compile or link errors to identify the spots in the code where a specific method is called from.
- SwellJoe 19y ago"How is it not related to the compile-time name resolution and type checking?" Please re-read, carefully. I said that compiled and strongly typed are two orthogonal language characteristics, and that each of those characteristics solves one set of problems (while introducing some of its own). I specifically said exactly what you've said about compiled languages identifying missing methods. But it's not because it is a strongly typed language, it's because it is compiled. What's so bad about having a little clarity in our use of terms and concepts?
- machine 19y agoA bit of semantics: what we are talking about here is the difference between statically typed and dynamically typed languages, not strongly and weakly typed. Python is strongly dynamically typed. Java is strongly statically typed. C is (arguably) weakly statically typed (because it let's you treat anything as anything through casts, void pointers, etc). The point jey was trying to make is that only languages that are both statically typed and compiled can catch missing methods. Consider for example a piece of code: a.doB(); If the language is not statically typed, then the compiler does not know the type of "a" at compile time, and therefore doesn't know what class to check for method "doB". This is why even if you were to compile python you would still end up getting missing method error messages occasionally.