Re: Newbie OOP question
From: Jerry Coffin (jcoffin_at_taeus.com)
Date: 05/05/04
- Next message: pdi: "Memory Leak Explanation"
- Previous message: Francis Glassborow: "Re: newbie want to write financial package"
- In reply to: David White: "Re: Newbie OOP question"
- Next in thread: David White: "Re: Newbie OOP question"
- Reply: David White: "Re: Newbie OOP question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 5 May 2004 09:00:28 -0700
"David White" <no@email.provided> wrote in message news:<atXlc.15153$KS1.314792@nasal.pacific.net.au>...
[ ... ]
> Well, I don't know how you can come up with the name CollectionOfBook
> without thinking of the object as a collection of books, however long you
> think of it.
Yes, I've already gone on record as stating that the name involved was
poorly chosen. The only question that's left is whether this section
was ever, in the slightest way at any time intended as a tutorial.
There's not really much room for question about that either: it
clearly was not!
[ ... ]
> It says: "As described in "Multiple Inheritance" on page 264, a class can be
> derived from more than one base class. In a multiple-inheritance model
> (where classes are derived from more than one base class)..."
> The writer felt the need to say twice that a class can be derived from more
> than one base class, and that's not counting page 264. Pretty basic stuff
> spelled out three times.
At the time this was NOT basic stuff -- multiple inheritance was quite
new, and nearly unique to C++ at that. It simply did not exist in
most previously well-known OO languages like Smalltalk and Simula.
The fact of the matter is that it has a minimal description of what
multiple inheritance IS, and then launches into a discussion of the
precise syntax used, and the order of construction and destruction.
[ ... ]
> No, but the C++ standard defines the entire language, and cannot assume that
> the reader knows anything at all about C++. If such examples are needed or
> helpful, then their presence is appropriate.
...which was exactly the case here as well. Remember that this was
publshed in early 1991. _The C++ Programming Language_ (first
edition) had been published, but described a language with only single
inheritance (among other things). The ARM hadn't been published yet,
but even if it had, it described a language that inclduded (a
primordial form of) templates. Neither was anywhere close to an
accurate description of the language they accepted. As such, MS had
little choice but to write some sort of manual describing the language
their compiler accepted.
This was also the first C++ compiler MS had ever published. As such,
they had little choice to to write their manuals based on the
assumption that the user had no familiarity with C++. Even if they
assumed familiarity with C++, multiple inheritance was a new feature
at the time anyway -- for comparison, consider this summary from
mid-1990:
http://www.google.com/groups?selm=3239%40se-sd.SanDiego.NCR.COM
Note in particular that at that time, support for multiple inheritance
was NOT universal at all.
[ ... ]
> Not possible. CollectibleString objects cannot be stored in a collection in
> which the element type is Collectible.
Well, of course we're all aware of slicing -- I was attempting to
present the situation without getting sidetracked into a 500 page
thesis about the problems inherent in writing collections in a nearly
15 year-old version of C++. Since we're all well aware of the details
anyway, it seemed (and still seems) quite pointless to go into lots of
details about it.
[ ... ]
> > A lot of people tried to come up with ways of making collections work
> > well within the language as it was defined at the time. If anybody
> > did a job that was much better than the example given, I (for one) am
> > unaware of its existence.
>
> Void pointers.
I see. Presumably, you also advocate curing a hangnail by amputating
the arm at the shoulder?
In case that wasn't clear: IMO, your proposed "improvement" is
drastically worse than the disease it purports to cure.
--
Later,
Jerry.
The universe is a figment of its own imagination.
- Next message: pdi: "Memory Leak Explanation"
- Previous message: Francis Glassborow: "Re: newbie want to write financial package"
- In reply to: David White: "Re: Newbie OOP question"
- Next in thread: David White: "Re: Newbie OOP question"
- Reply: David White: "Re: Newbie OOP question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|