comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shell5.ba.best.com>
Subject: Re: Which book for ADA beginner ?
Date: Mon, 29 Jan 2001 17:46:21 GMT
Date: 2001-01-29T17:46:21+00:00	[thread overview]
Message-ID: <Pine.BSF.4.21.0101290934460.25760-100000@shell5.ba.best.com> (raw)
In-Reply-To: <3a74c829_2@news3.prserv.net>

On Sun, 28 Jan 2001, Andrzej Lewandowski wrote:
> "Brian Rogoff" <bpr@shell5.ba.best.com> 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





  parent reply	other threads:[~2001-01-29 17:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3A71400E.32057C6B@becker.k.pl>
2001-01-26 15:16 ` Which book for ADA beginner ? Jerry Petrey
2001-01-26 15:42 ` BSCrawford
     [not found] ` <slrn972q4p.k7.randhol+abuse@kiuk0156.chembio.ntnu.no>
2001-01-26 16:52   ` Brian Rogoff
2001-01-26 17:06     ` Preben Randhol
2001-01-27  2:15     ` Andrzej Lewandowski
2001-01-28 13:43       ` Preben Randhol
2001-01-28 18:29         ` Brian Rogoff
2001-01-29  2:28           ` Andrzej Lewandowski
2001-01-29 14:03             ` OO and modules ( was Which book for ADA beginner ?) Hans-Olof Danielsson
2001-01-29 15:58               ` James Rogers
2001-02-02 22:07                 ` Mark Lundquist
2001-02-02 22:06               ` Mark Lundquist
2001-01-29 17:46             ` Brian Rogoff [this message]
2001-02-02 20:11             ` Which book for ADA beginner ? Mark Lundquist
2001-02-02 21:58           ` Mark Lundquist
2001-01-28 16:21 ` squeaker
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox