3 ms·
sure it is, you can have syntactically correct programs that do the wrong thing because of name lookup. That name lookup is ambiguous.
by braveo 10y ago
sure it is, you can have syntactically correct programs that do the wrong thing because of name lookup.
That name lookup is ambiguous.
- pvg 10y agoWhat's an example of such a program?
- braveo 10y agoI'm not going to play that game, if you can't think of an example of a dynamic language that's syntactically correct but fails at runtime due to name lookup issues, that's on you, but it doesn't change the validity of the point.
- pvg 10y agoVery well.
- cortesoft 10y agoI think he should have said that we don't need tests 'only' because of ambiguity. Even with no ambiguity at all, would still be needed.
- pvg 10y agoYou're in an empty room with a light switch. GLaDOS says 'please turn on the light'. You flip the switch and the floor disappears, dropping you into a pool full of hungry gators. That doesn't make 'turn on the light' ambiguous.
- braveo 10y agoThankfully, that's not how programs work, so your analogy doesn't really apply.
- kolme 10y agoNo, dynamic languages are not "ambiguous" in any possible way. Programming languages are unambiguous by definition, as any formal languages. What they are, indeed, is dynamic. The lookups you are talking about are done in runtime, so the result of these lookups can vary depending on the state in memory at a given time. That doesn't mean they're ambiguous. Everything is perfectly unambiguous and deterministic. They're just dynamic. And that's fine. FYI: People also write tests in static languages.