Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!igor!rutabaga!jls From: jls@rutabaga.Rational.COM (Jim Showalter) Newsgroups: comp.object Subject: Re: Readability of Ada Message-ID: Date: 26 Apr 91 20:39:12 GMT References: <3878@ssc-bee.ssc-vax.UUCP> <20245@alice.att.com> <1991Apr23.193715.23815@odin.diku.dk> <1991Apr25.170356.21237@odin.diku.dk> Sender: news@Rational.COM Lines: 80 >Apparently, while arguing *against* the usefulness of inheritance, I did no such thing. I merely asked how to do a simple thing in C++. The answer, so far, is "Uh, well, that's not one of the things you can do easily in C++." Considering that my original question was motivated by Bjarne Stroustrup's somewhat self-serving comparison of the ease with which he can express inheritance in C++ vs Ada, I think pointing out that I can find a large number of quite simple couterexamples in which it is no cleaner in C++ than Ada (and Ada doesn't HAVE inheritance...) is fair. >at the same time you are demanding that inheritance be used to >it's full potential. Let's take a vote: how many OO afficionados out there believe that being able to add additional operations to derived classes is a tremendously radical desire on the part of someone using inheritance? >I agree that self-identification should be a language feature, and >as far as I know, it will be. But I still don't think it's a >a C++ problem, because it's so easy to add an equivalent feature >to any given class hierarchy. Provided you have the source code. Right. Now reread my example: the existing class hierarchy is delivered in BINARY. This is the real world: people want to protect their source. So, you don't HAVE source code. Now run off and try again to solve my example. I'll be here when you get back... >>Uh huh. All the more reason not to oversell the benefits of inheritance, >>considering you said earlier that building class hierarchies was very >>difficult. If it is really that difficult--and I argue it is--then >>Joe Blow is going to shoot his foot off. Giving the run-of-the-mill >>hacker the ability to screw up in increasingly subtle and grandiose >>ways does NOT strike me as a Great Leap Forward. >Who said object-oriented programming was for novices? Well, gee--just about every marketing blurb I've read about it since about 1985. You know, the stuff that reads: "Hey, Mr. Software Manager, I'm Mr. Object and I'm here to help you and your team be ever so much more productive than you've been in the past! Object-oriented programming is MORE NATURAL, MORE INTUITIVE, MORE EASY than any other kind of programming. Why, a PINHEAD can do it!" and so forth and so on. Now, I know from experience that this is a load of crap...but until the snake oil salesmen stop selling snake oil, I think it's fair to hold them to their claims, don't you? > As for C++, the language is intended as the OOP upgrade >for C programmers -- i.e. not novices. Uh, I regard at least a significant number of C programmers as novices. I mean, they learn it in school, right? >Is this some kind of contest, where solutions are required not to >make use of any language features also found in Ada? Frankly, yes. since I was responding to Bjarne Stroustrup's claim that inheritance was a paradigm not well-supported by Ada, in contrast to C++. So it seems QUITE fair to me to come up with what I consider simple examples of places where C++ support for inheritance degenerates into the exact same solution you'd use in a language that doesn't even claim to HAVE inheritance. Does this seem unfair to you? If so, WHY? >I don't have time for writing examples tens of thousands of lines long. Right, and neither, I've noticed, does anybody else. What they do instead is write dinky toy examples a few hundred lines long, if that, write a book, and sell snake oil to the masses. People who actually then try to take the mechanism demonstrated in the toy example and apply it to the real world soon discover that things are a lot nastier than they'd been led to believe. It is from experiences like this that folks wind up writing "Emperor Strikes Lethe" essays: after all, this is from a guy who TRIED to build OO systems and ran into all kinds of problems. The Cognos boondoggle is another example of magnificent failure. And my simple examples of C++ inheritance collapse are another. -- * "Beyond 100,000 lines of code, you should probably be coding in Ada." * * - P.G. Plauger, Convener and Secretary of the ANSI C Committee * * * * The opinions expressed herein are my own. *