Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!mips!pacbell.com!pacbell!m5!tma From: tma@m5.COM (Tim Atkins) Newsgroups: comp.object Subject: Re: Do we really need types in OOPL's? Message-ID: <3851@m5.COM> Date: 3 Oct 90 01:14:48 GMT References: <0yw10qr@Unify.Com> <411@eiffel.UUCP> <736@tetrauk.UUCP> <1990Sep25.135145.3460@kth.se> <3832@osc.COM> Reply-To: tma@m5.UUCP (Tim Atkins) Organization: Object Sciences Corp., Menlo Park, CA Lines: 51 In article cline@sun.soe.clarkson.edu (Marshall Cline) writes: >In article <3832@osc.COM> tma@osc.COM (Tim Atkins) writes: >... >> I also disagree that "strong" typing cannot be simulated in a >>dynamically typed language. Type or even protocol tests can be inserted at >>will and could probably be automated in fairly clever and efficient fashion. > >This reveals probably the most common communication problem: nomenclature. >What is usually meant by ``strong'' typing is ``static'' typing (cf. Booch >OOD, Meyer OOSC, etc). Ie: saying that an OOPL is strongly typed means >things like: the compiler can tell, from the *text* of the program alone, >whether or not an object will be equipped to handle a particular message. >Strong (static) typing does *NOT* mean the compiler knows what the message >will *do*, the latter being static binding. > Granted. I usually tend to steer away from the terms "strong" vs. "weak" in regards to typing but I slipped up here. >Static binding says the compiler knows (from the text of the program alone) >the exact member function that will be called. Dynamic binding and static >typing coexist wonderfully, existence proofs being C++, Simula, Eiffel, etc. I take a bit of exception to C++ in this context. Dynamic binding means that that binding is done a run-time based on the run-time type of the receiver and the message sent. C++ emphatically does not support this. Instead it uses static type information to calculate the offset relative to a type specific pointer location within the receiver where the function may be found. There is no run-time lookup at all except to simply do the simple array reference. > >Strong typing is especially valuable for programming-in-the-large where the >edit-compile-debug cycle is especially tedious. All other things being >equal (they're not), ``sooner'' error detection is better than ``later''. > >Marshall Cline > Ah, but I would contend that static typing environments necessitate to a large degree just the type of ills you represent them as curing. It is much more difficult to create an incremental, highly interactive develop- ment environment for a statically typed language. One also has commonly more code to debug as the re-useability is a bit more constrained by many of the static typing models. In a dynamically typed interactive environment I believe I will catch errors much faster because changes are incremental and because I tend to test much more when I don't have to "edit-compile-link" a new program just to test a new feature. - Tim Atkins