Abstraction -- programming methodology
- control abstractions
-- structured programming
- data abstraction
-- information hiding
The kind of abstraction provided by ADTs can be supported
by any language with a procedure call mechanism
(given that appropriate protocols are developed
and observed by the programmer). [DT88]
slide: Abstraction and programming languages
Roughly, we may distinguish between two categories
of abstractions: abstractions that aid in specifying
control (including subroutines, procedures,
if-then-else constructs, while-constructs,
in short the constructs promoted by the school of
structured programming in their battle against
the goto);
and abstractions that allow us to hide
the actual representation of the data employed
in a program (introduced to support the information hiding
approach, originally advocated in [Parnas72a]).
Although there is clearly a pragmatic interest
involved in developing and employing such abstractions,
the concern with abstraction (and consequently types)
is ultimately motivated by a concern with
programming methodology and, as observed in [DT88],
the need for reliable and maintainable software.
However, the introduction of language features
is also often motivated by programmers' desires
for ease of coding and naturalness of expression.
In the same vein, although types were originally considered
as a convenient means to assist the compiler in producing
efficient code, types have rapidly been recognized
as a way in which to capture the meaning of a program in an
implementation independent way.
In particular, the notion of abstract data types
(which has, so to speak, grown out of data abstraction)
has become a powerful device (and guideline)
to structure large software systems.
In practice, as the quotation from [DT88]
in slide [8-abstraction] indicates,
we may employ the tools developed for structured programming
to realize abstract data types in a program,
but with the obvious disadvantage that we must rely on
conventions with regard to the reliability of these
realizations.
Support for abstract data types (support in the sense
as discussed in section [paradigms]) is offered (to some extent)
by languages such as Modula-2 and Ada by means of a syntactic
module or package construct,
and (to a larger extent) by object-oriented languages
in the form of object classes.
However, both realizations are of a rather ad hoc
and pragmatic nature,
relying in the latter case on the metaphor of encapsulation
and message passing.
The challenge to computer science in this area is
to develop a notion of types capturing the power
of abstract data types in a form that is adequate
both from a pragmatic point of view (in the sense
of allowing efficient language support) and from
a theoretical perspective (laying the foundation
for a truly declarative object-oriented approach
to programming).