ajs@prg.ox.ac.uk (Adolfo Socorro) (12/10/90)
In reply to my reply on examples of multiple inheritance, brandis@inf.ethz.ch (Marc Brandis) wrote: > The fact that there > are examples in the real world where a thing has properties of several other > things does not imply that you need multiple inheritance in a programming > language. Very often, the kind of situations that you are describing can be > solved by using references to other objects and just deriving from one class. > You may argue that this is not a direct projection of the real world into > the program, but this is not needed at all. The whole point about object-oriented design and programming is to make descriptions and implementations more like what (we think) is really out there, so that less levels of conversion between our observations and our implementations are needed. Forcing descriptions that come "naturally" with multiple inheritance into less obvious descriptions that use single inheritance plus some hacking runs contrary to this spirit (especially with so many good examples already contributed to the net); such actions would be a step backwards. Since maintenance is what takes up the largest chunk in the life of a system, we should be striving for more comprehensible programs. Readability is the single best criterion of program quality: if a program is easy to read, it is probably a good program; if it is hard to read, it probably isn't good. -- B. Kernighan & P. Plauger, Software Tools, Addison-Wesley, 1976. The problem may lie in that inheritance is not properly used, and that the separation of specs and implementations is not well-supported (if at all). But the technology is very new, and banning it is certainly not the answer. Hopefully, something good will evolve as we understand it better. Adolfo Socorro