Xref: utzoo comp.lang.c++:6492 comp.object:945 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!megatest!djones From: djones@megatest.UUCP (Dave Jones) Newsgroups: comp.lang.c++,comp.object Subject: Re: Inheritance vs. Composition Message-ID: <12029@goofy.megatest.UUCP> Date: 15 Feb 90 01:03:38 GMT References: Organization: Megatest Corporation, San Jose, Ca Lines: 40 From article , by pcg@rupert.cs.aber.ac.uk (Piercarlo Grandi): ... > > The inheritance issue is bogus and clouds the real problem ... Hear! Hear! I've been wanting to say this, but I've been reluctant to get into the scrap with people who know all the fashionalble buzz-words. > ... [ to ] map the concepts ultimately onto contiguity or > pointers (the only ways we have in a computer to indicate a > relationship between data). > That's what this all comes down to isn't it? That and what kind of shorthand-resolution you want the compiler to do for you. (Not easy questions, actually.) When I get into a discussion of this stuff, and inevitably somebody says something like, 'But that can all be solved with post-recurrent semideclined prevaricated polytrophism,' I say, 'Mumble, ... refresh my memory on what that means. What do the compiler's lookup-tables do, and when do you use pointers at runtime?' > Just think that inheritance could be entirely obviated if one were > allowed to use composition with nameless members, or if a member could > be identified by any unambiguous path to it, like in PL/1. > Did PL/1 do that? It's been so long since I used that language -- over fifteen years I guess -- I've forgotten most everything about it. PL/1 has been ragged so hard over the years, it seems strange to hear one of its features mentioned in a positive way. For the last few years, just for the fun of it, I've been dreaming up my own sequential imperative language. Don't know if I'll ever get around to implementing it. I had decided that all this 'inheritance' and 'composition' debate comes down to nothing more than when to use pointers and what kind of shorthand you prefer. I decided on a scheme similar to the ones you describe. Ditto with function-members. It's good to know that at least one other person on this planet sees things the way I do.