ajs@prg.ox.ac.uk (Adolfo Socorro) (11/16/90)
I'd like to comment on the distinction between abstract data types and classes. ADTs describe Platonic or ideal entities, i.e. they do not and cannot change, like the colors or the natural numbers. Classes describe objects, which are entities that persist and evolve with time, like buildings and planets. This separation is not only clean conceptually, but also has favorable implications on compiler optimization techniques, for elements of types are constant. Many oop languages optimize for built-ins, like the numbers, and there is no reason not to take advantage when such information is supplied by the programmer. Regarding the distinguishing properties of types and classes, note that encapsulation and information hiding can occur at both levels, and thus cannot be the distinguishing characteristic of either. Also, it is not possible that inheritance is the essence of object-oriented programming, as there exist functional languages with (multiple) inheritance; for example, OBJ3. So it must be that the essence of oop is locality of state. I don't know of any non-object-oriented language that supports dynamic binding. However, this may not be a distinguishing property either, as I see no reason why it can't be a feature of a functional language with inheritance. (In the case of OBJ3, however, the semantics do not, strictly speaking, permit dynamic binding. But it can be faked with the appropriate compilation machinery.) Adolfo Socorro