comp.lang.ada
 help / color / mirror / Atom feed
From: mauney@ncsu.UUCP (Jon Mauney)
Subject: Abstraction In Ada
Date: Mon, 18-Jun-84 15:28:31 EDT	[thread overview]
Date: Mon Jun 18 15:28:31 1984
Message-ID: <2620@ncsu.UUCP> (raw)
In-Reply-To: 2144@mit-eddie.UUCP

Ada is a complicated and rather ponderous language,  and I can 
understand why people might not like it.  But I think that one
of Ada's strengths is a pretty good data abstraction facility.
Therefore I would like to see an elaboration of any complaints
in that area.

Specifically:  (from mit!nessus)

> To do a good job with data abstraction, you really need heap-based
> allocation with automatic garbage collection.  Ada doesn't support this.

I don't see how this follows,  except that lack of a garbage-collected
heap restricts your ability to implement an ADT using a garbage-collected
heap.  There are advantages and disadvantages to heap allocation of
data objects;  I don't see how they relate to abstraction.

> Also, Ada's private type system is completely messed up.  "Private
> types" have their assignment and equality operations provided by the
> system.  This is the wrong thing since two abstract objects may be
> different from the concrete view (the view that Ada's "=" operation
> takes), but equal from the abstract point of view.  And the assignment
> operation is supposed to copy the object being assigned, but the system
> provided operation can't do that right either.  You can do a little
> better with "limiited private types".  You can then provide your own "="
> operation, but you still can't provide your own ":=" operation.  And
> even if you do define your own "=" operation for a limited private type,
> Ada then won't allow you to use "=" on a composite type that contains
> that type.

Ada gives the "package" designer three choices: (A) a type can be
declared right in the package specification, which means everyone can
use the information to write code that is totally dependent on the
particular representation chosen. (B) a type can be declared "private,"
which means that even though everyone knows how the type is
implemented, they can't write code that depends on it.  Two operations,
assignment and equality testing, are provided by the system.  This is
convenient in many cases, because the system-supplied operations are
exactly what you want. (C) a type can be declared "limited private."
In this case the only operations supplied by the system are declaration of
variables (an essential ability) and passing as parameter (also
essential).  This is useful in many cases, because the system-supplied
operations are not appropriate to the particular abstraction or
implementation.  The '=' operator may be overloaded, and definition of
'=' automatically implies definition of '/='.  Sad to say, ':=' is
not an operation that can be overloaded, and assignment of limited
private types must be done using a different syntax.  This system is
not without its defects, but is it really so horrible?

> Basically, Ada is just gross.  Bleah!

The above opinion is frequently heard. Practically every language has been
substituted for Ada at some point.  This prompts me to issue the following
challenge,  pretty much unrelated to the above discussion:
     Can you name a language that will not elicit a "Bleah" from someone
on the net?  Languages so obscure that no one on the net has heard of them
do not qualify.  Mail any suggestions to me; I will collect them and try
to find an objective method of getting a response from the net at large.
The winner will receive a barbeque sandwich from the Blue Mist, Asheboro, NC.

-- 

_Doctor_                           Jon Mauney,    mcnc!ncsu!mauney
\__Mu__/                           North Carolina State University

       reply	other threads:[~1984-06-18 19:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1979@mit-eddi.UUCP>
     [not found] ` <5400007@ea.UUCP>
     [not found]   ` <7506@umcp-cs.UUCP>
     [not found]     ` <2144@mit-eddie.UUCP>
1984-06-18 19:28       ` Jon Mauney [this message]
1984-06-22  7:47         ` Abstraction In Ada Doug Alan
1984-06-25  2:15           ` brad
1984-07-17 10:34             ` garbage collection Eric Smith
1984-06-25 16:45         ` Abstraction In Ada Jon Mauney
replies disabled

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