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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9982360189bfe852 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-29 09:45:57 PST Path: supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!sjc-peer.news.verio.net!news.verio.net!sjc-read.news.verio.net.POSTED!not-for-mail Newsgroups: comp.lang.ada From: Brian Rogoff Subject: Re: Which book for ADA beginner ? In-Reply-To: <3a74c829_2@news3.prserv.net> Message-ID: References: <3A71400E.32057C6B@becker.k.pl> <3a72224b_2@news3.prserv.net> <3a74c829_2@news3.prserv.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Mon, 29 Jan 2001 17:46:21 GMT NNTP-Posting-Host: 206.184.139.136 X-Complaints-To: abuse@verio.net X-Trace: sjc-read.news.verio.net 980790381 206.184.139.136 (Mon, 29 Jan 2001 17:46:21 GMT) NNTP-Posting-Date: Mon, 29 Jan 2001 17:46:21 GMT Organization: Verio Xref: supernews.google.com comp.lang.ada:4668 Date: 2001-01-29T17:46:21+00:00 List-Id: On Sun, 28 Jan 2001, Andrzej Lewandowski wrote: > "Brian Rogoff" wrote in message > news:Pine.BSF.4.21.0101281019400.7734-100000@shell5.ba.best.com... > > I can't speak for Andrzej, but I did notice on perusing the programs at > > the web site > > > > http://www.brighton.ac.uk/ada95/programs/home.htm > > > > that Smith tends to use packages as classes. I'm not disposed towards that > > approach, but I'm also not disposed towards "OO uber-alles" in general so > > take that however you want to. I don't think that tagged records make > > variant records obsolete (yes JE, I wish you'd change your book :), so > > I'd like Ada books to cover a few approaches. > > > > Some people express the opinion that the necessary condition for a language > to be OO is that this language has classes. These classes MUST be C++ > style. I assume that you mean here that class mechanisms are used for encapsulation control, or in the Eiffel terminology that classes are types are modules? I really dislike this kind of language. > Ada95 (and Oberon; it is interesting what was the impact of Oberon > and Wirth's work on extensible types on Ada 95 design of tagged types, if any) > has different mechanism. Moreover, it has been pointed out (see the book on component > programming by Szyperski and his presentation on one of ECOOPs) that > object orientation and modules are in principle orthoogonal concepts, and > that BOTH and SEPARATE are required to build well structured OO programs. OK, but even here I think the focus on OO is too strong. One can build well structured, large, maintainable programs with no OO at all. Indeed, OO language features, like open recursion, are actually a bit dangerous, and the flexibility they give you has to be managed carefully. One of the other OO languages I use, Ocaml, also has modules and classes. Since it has higher order functions, the need for OO style runtime dispatch is significantly reduced. The functional language Erlang is also used to construct some very large programs and Erlang does not have OO features. > C++, Eiffel, Smalltalk ond others are using classes for both purposes: OO and > encapsulation (say, modularization). Ada95 and Oberon are two (well, maybe not > the ONLY two...) languages that separate these two notions. In other words, these > languages are the only languages that make this RIGHT. Therefore, an attempt to > emulate C++ classes in Ada95 just to have the same mechanisms as in > C++ is not a prograss, it is a step backward. I agree with this. Someone else points out that C++ has "namespaces" now. I believe that Sather, an Eiffel descendant, will get a simple module system too. When teaching Ada one should learn about packages as a module system, not as a way to hack Eiffel/C++ classes out of tagged records. -- Brian