Inheritance vs E
Tyler Close
tyler@lfw.org
Fri, 23 Oct 1998 11:53:09 -0400
At 07:45 AM 10/23/98 -0400, you wrote:
>This basically eliminated the last useful C++ leverage in the EROS
>kernel, and it is my intent to recoded the kernel in C. I have not
>gotten around to doing so yet.
Whoa, that seems extreme. Perhaps I should just clarify that when I say
that I don't use inheritance, it doesn't mean that I don't use common
interfaces. Because of strong typing, I often make use of templates or
virtual inheritance of pure abstract classes (Java interfaces). I don't
know how I could work in a strongly typed language without these features.
>
>> ... inheritance is a bad idea. Jonathan has said that he has made
>> the same discovery....
>
>I'm not sure I would go that far. Multiple inheritance is an
>unmitigated disaster. I can still see cases where single inheritance
>is potentially useful. I think, however, that it is worth exploring
>whether interfaces (facets, if you like) provide the same advantages
>with fewer problems. I suspect strongly that the answer is
>``interfaces are better.''
Well, it seems I jumped the gun a bit in reading your post. Sorry.
In a strongly typed language, "interfaces are better" and interfaces are
absolutely necessary; however, in an untyped language, all they do is move
design documentation from the word processor to the compiler.
Tyler