From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2ea02452876a15e1 X-Google-Attributes: gid103376,public From: kennel@msr.epm.ornl.gov (Matt Kennel) Subject: Re: Real OO (was Choice of OO primitives in Ada95) Date: 1996/02/22 Message-ID: <4git9e$cqi@stc06.ctd.ornl.gov>#1/1 X-Deja-AN: 140625093 references: <199602221711.SAA18350@email.enst.fr> organization: Oak Ridge National Lab, Oak Ridge, TN newsgroups: comp.lang.ada Date: 1996-02-22T00:00:00+00:00 List-Id: Jean-Pierre Rosen (rosen@EMAIL.ENST.FR) wrote: > >Taking each in turn (and not attempting to justify them), > > > >1) Best provided by pure OO (eg. Eiffel, Smalltalk) followed by hybrid OO > > language with proper classes (extendable types mapped onto modules) > > eg. (C++, myriad others) followed by hybrid OO with non-encapsulated classes > > (eg. Ada, CLOS?). > Of course, I do not agree. For example, the presence of ONCE functions in > Eiffel is a kludge to overcome the absence of package initialization that is > nicely provided by Ada. Um maaaaybe, but 'once functions' do what they do with no fuss and with very clear semantics, without having to define an "elaboration" notion for packages. I'm not sure that's a "kludge" compared to the complexity of package initialization in Ada. > And as for separating specs and implementations, Ada > is the only language that does it nicely, without giving up safety. This isn't true. You write abstract classes in Eiffel/Sather/C++ which has the spec (including pre/post/invariant) and write an implementation class which supports it. What is the problem? > > > >2) The linchpin of OO - any language claiming to be OO offers this. > Including Ada 95, although I still think it has been overadvocated. > > > >3) The only significant OO language I know of that offers this is Eiffel. > > Assertions are executable conditions which must be satisfied to guarantee > > that an abstraction has a valid state whenever it is updated. These include: > > [...] > It was considered in the early stages of Ada (83) design, and rejected. > Note also that assertions in Eiffel are much LESS reliable than one could > think, since assertions are disabled while evaluation the condition for an > assertion. This is necessary to prevent semantic dependencies to end up in > infinite recursion, but limits the trust you can have in assertions. No. Meyer figured out, quite successfully IMHO, exactly the kinds of rules that you need to turn "assertions" from just 'check this predicate and bomb if false' into a powerful *human* protocol "programming by contract". These special rules are exactly what you need so you CAN trust assertions, because it means that you can put in truly useful checks that don't barf because of stupidities like the above. > > > >Note that Ada only fully satisfies 2) and has a sub-optimal mechanism for 1). > I have a package for 3) if you want. It's less than 50 lines long, including > comments. > So what ? Your statements were biased towards the conclusion that Eiffel was > the only appropriate language. I can come up with equally biased statements > that will "naturally" conclude that Ada is the best OOP language. What > about, for example: > OOP is about modelling real-world objects. Since real-world objects evolve > concurrently, no language should be called OO unless it provides concurrency. > OK, this kills C++, Smalltalk, Eiffel, CLOS.... OOP is about modelling real-world objects. Since real world objects couple to the Einstein mass-energy tensor, no langauge should be called OO unless its operation can provide sufficient extra energy dissipation to cause similar effects. :-) I think it *is* quite fair to say that Eiffel is more object-oriented---ok more oriented-around-objects than Ada 95: it's the idee' fixe for Eiffel. This doesn't prove 'prima facie' superiority, though I tend to like Eiffel better. (I've never been convinced about kludges to handle the 'multiple withing' problem). > +------------------------------------o-------------------------------------+ > | P-mail: | E-mail: rosen@enst.fr | > | ADALOG - 27 avenue de Verdun | Tel: +33 1 46 45 51 12 | > | 92170 Vanves - FRANCE | Fax: +33 1 46 45 52 49 | > +------------------------------------o-------------------------------------+