5 ms·
It means when you have a name for something, the association between the name and the thing should be done as late as possible. In the case of a method call, th
by bitwize 15y ago
It means when you have a name for something, the association between the name and the thing should be done as late as possible. In the case of a method call, the method to be invoked for a given message name should take place at the time of the call.
I've a lot of respect for Dr. Kay, but history has shown him to be wrong on this point: strong static typing and binding things as early as possible is how robust systems are built and how errors are minimized.
However I won't doubt that the Smalltalk approach is probably right for its original intended purpose (exploratory or didactic programming).
- swannodette 15y ago> strong static typing and binding things as early as possible is how robust systems are built and how errors are minimized. Huh? What about Erlang?
- prodigal_erik 15y agoErlang is very good at making systems that can sort of muddle along and keep running despite containing serious mistakes, but it's almost no help with preventing or fixing them. Every static type (even inferred) does the work of a number of unit tests, though of course not all.
- swannodette 15y agoI suppose you've never head of Dialyzer which gives much better coverage than most static type systems.
- prodigal_erik 15y agoNo I had not. If Erlang now has working type checking, that's a huge advance. But I have to wonder why the Wikipedia page still claims Erlang is dynamically typed and doesn't mention this, and the getting-started guide barely names Dialyzer and doesn't demonstrate it at all (instead it's somewhere in the middle of the FAQ). How much consensus is there that it's ready for prime time?
- chc 15y agoThe fact that you can analyze the types doesn't necessarily change the fact that the language is dynamically typed (accepting that the terms are kind of wavy to begin with, and I've heard people mistakenly apply the D-word to very strongly statically typed languages with type inference).
- silentbicycle 15y agoIt's still dynamically typed. The dialyzer ("discrepancy analyzer") can detect many kinds of type errors statically by doing dataflow analysis over the possible types yielded by successful execution, but it's an external tool. Like lint, not part of the core language. For a good overview, check "Gradual Typing of Erlang Programs: A Wrangler Experience " (http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.160.140&rank=1 http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.160....) and/or "Practical type inference based on success typings" (http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.62.3859&rep=rep1&type=pdf http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.62....).
- lmkg 15y ago> I've a lot of respect for Dr. Kay, but history has shown him to be wrong on this point: strong static typing and binding things as early as possible is how robust systems are built and how errors are minimized. Could you expand on this? I don't see how late binding is incompatible with the robustness that static typing provides. In a traditional (C/++/#/Java) OOP setting, virtual methods and dynamic method dispatch allow for late-binding of method names to behavior based on run-time type specializations, but you still have the static compile-time guarantee that a method with the appropriate name and type signature will exist. This seems to me like it has the same robustness as an early-bound model, bounded only by the sophistication of the type system. Do you consider it qualitatively less late-bound than the message-passing paradigm, or am I missing something?