Y'ello Pierre!
16 Apr 97, Jerry Coffin had to endure Pierre Phaneuf's ramblings (shown
below).
PP>>> There is *many* questionable things about C++... Like for
PP>>> example, (regarding pure virtual functions) what happens if
PP>>> I put something else than 0 after the =??? Like in "virtual
PP>>> void fn() = 42"?
JC>> Assuming your compiler works correctly, you get an error
JC>> message.
PP> Why did they choose to make such a simple thing, obviously crying
PP> for a simple "flag keyword", such a easy to mess up thing as this
PP> "= 0" crap?
Come on, Pierre, only a turkey could mess it up. It's not as though it
changes, it's always = 0. Stop being a big baby and take it like a man. ;)
PP> This is the arch-example of multiple
PP> constructor in Borland Pascal, as this is used throughout the
PP> streaming mecanism of Turbo Vision.
Don't come the TurboVision stuff with me. We were forced to use it for a
group project, thinking it would be quicker than developing our own
nterface.
What a nightmare. There is no way to escape from the UI. Everything you do
relies on direct contact with TV, and as soon as you want to make a change,
you
have to hunt through all your source code. Nightmare. Maybe that was just
us.
JC>> they're talking about. I think Booch said it well: MI is a
JC>> bit like a parachute. You don't need it very often, but
JC>> when you do need it, you REALLY need it.
PP> I have yet to see a case where I'd *REALLY* need it.
But why, Pierre? It seems perfectly logical that a class could have the
characteristics of two seperate super-classes. In C++, I think the I/O
tream
heirarchy looks like:
stream
|
+------+------+
| |
istream ostream
| |
ifstream ofstream
| |
+------+------+
|
iostream
Is that right? I can't remeber if that's it exactly, but, in any case it
makes
sense that iostream should inherit from both the input and the output
classes. I
must admit, getting your head around it by the time you come to code is
awkward.
Java does a sort of multiple inheritance which (forgive me) is a bit easier
o
use. A class can EXTEND a base class, but also IMPLEMENT a number of other
abstract base classes. Clever, because the object IS-A
but at the same time, must provide implementations for the methods within the
abstract classes which it IMPLEMENTS. You probably know all that, but I
hink
it's interesting and perfectly clear to see when it's used.
PP> I think of it as the GOTO of
PP> object-oriented programming and makes me puke just like the
PP> original GOTO... ;-)
Come, come. :) Like you, I loathe GOTO, and would always use variable to
terminate a loop, or use an IF the execute relevant code, but MI is an unfair
comparision. GOTO slaps structured programming in the face whereas MI is a
natural compliment to OOD, consistent with the methodology.
PP> I remember seeing a framework for a particular version of Object
PP> Pascal that supported multiple inheritance... It actually
PP> *relied* on it and positively was the most illogic and barfulous
PP> piece of design I ever saw in a distributed library.
Yep, that's Pascal for ya. ;) Couldn't have phrased it better myself. Ooh.
MLIBTYL ;b
Fido = 2:259/33
--Craigzilla++ Internet = McMoose@sol.co.uk
WWW = http://www.taynet.co.uk/users/mcmoose/
--- GEcho 1.00
---------------
* Origin: The Kilted Bun, Letham Angus -- hame o' the McMoose (2:259/33)
|