comp.lang.ada
 help / color / mirror / Atom feed
From: "Marc A. Criley" <mcriley@icdc.com>
Subject: Re: Top 10 Language Constructs (Ada)
Date: 2000/07/15
Date: 2000-07-15T00:00:00+00:00	[thread overview]
Message-ID: <3970F56F.F3A70FAD@icdc.com> (raw)
In-Reply-To: 8kmjja$l5h$1@pollux.ip-plus.net

Bruno Gustavs wrote:
> 
> What do you think are the top ten language constructs in Ada?
> Please don't answer in terms of OO concepts, but try to restrict
> yourself to those statements you really use to cope with your
> daily work.
> 
> Curious why I'm asking this question? In spite of all requirements
> engineering effort we know exactly *how* to solve problems
> with computer languages but know fairly, *what* we're doing
> during this process.
> 
> Regards
> Bruno Gustavs

I don't find looking at Ada in terms of "Top 10 Constructs" especially
enlightening.  (I'm not criticizing that approach, it just isn't in sync with my
point of view :-)

The critical foundation of the Ada programming language is its "type model". (In
claiming this I want to credit Doug Bryan for triggering this insight for me at
an Ada conference seminar about a dozen years ago.)

Any decent programming language has to have some programming paradigm that it
seeks to embody with syntax and semantics.  This paradigm can be obvious within
the language or somewhat obscured, depending on how well it is defined and
captured in the programming constructs.

- Smalltalk's programming paradigm is clearly inheritance
- A variety of languages are oriented around logical expressions (Lisp, Prolog)
- Java's paradigm appears to focus on the "interface" concept, though that's not
particularly obvious at first glance, given as its technical hype is typically
"C++ with garbage collection"
- C manages memory contents and addresses (it's effectively a portable assembly
language, and I don't intend that in the perjorative sense).

For COBOL, Fortran, Eiffel, etc., I'll leave it for others with hands on
experience to characterize those.


Ada, then, is built around its type model.  In a strongly typed language, a
startingly signifiant amount of information can be embedded within the code
through the intelligent use of types.  Most of the technical advocacy for Ada
that mentions its strong typing aspect usually centers around range checking,
and neglects almost everything else strong typing provides.

Experienced Ada programmers almost take for granted attributes like 'first,
'last, 'pred, 'succ, 'image, 'value, 'length, 'range, and the many others. 
Well, without Ada's typing model, you get at best a subset of these, and likely
only a handful.

Consider the parameter of this procedure specification:

  procedure Process_Data(Data : in out A_Data_Array_Type);

Knowing that Data is an array, consider all the attributes available to extract
all the information possible about that Data parameter given only what's
provided in the declaration you see.

Contrast that with a corresponding C declaration:

   void processData(aDataArrayType *data);

What can you determine about this *data parameter?


When tries to determine what paradigm Ada's syntax and semantics are trying to
embody, the majority of it centers around the type model.

- Concurrency is provided as protected types, task types, or tasks (which is
really a degenerate task type)
- Generics provide static polymorphism
- Tagged types provide inheritance and dynamic polymorphism
- Dynamic invocation is implemented by "access subprograms", i.e., "subprogram
types"

Certainly other languages employ the same type-centric approach for their
corresponding constructs (and of course inheritance is pretty much type-centric
by definition), but none to the same unified level of capability and consistency
as Ada.

(In fact, the only significant construct that could have been type-centric, but
wasn't, was exceptions.  And even those have started sliding that way in Ada 95
with its introduction of "exception objects".)

By exploiting Ada's type model, programmers embed an incredible amount of
supporting information within their software...and can then extract it and put
it to work through the use of Ada's attributes.

This, to my mind, is the most powerful and fundamental construct of Ada: the
type model that underlies the language and serves as a repository of information
for aiding the production, quality, and reliability of software.

Marc A. Criley




  parent reply	other threads:[~2000-07-15  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-14  0:00 Top 10 Language Constructs (Ada) Bruno Gustavs
2000-07-14  0:00 ` Andrew Hately
2000-07-14  0:00 ` David Kristola
2000-07-14  0:00 ` Samuel T. Harris
2000-07-15  0:00   ` Simon Wright
2000-07-18  0:00     ` Nick Keighley
2000-07-15  0:00 ` Marc A. Criley [this message]
2000-07-16  0:00   ` David Botton
2000-07-18  0:00   ` David Kristola
2000-07-18  0:00     ` Stefan Skoglund
2000-07-18  0:00     ` Bill Brennan
2000-07-18  0:00       ` Dr. Joachim Schr�er
2000-07-19  0:00         ` Bill Brennan
2000-07-18  0:00           ` Scott Ingram`
2000-07-21  0:00         ` Keith Thompson
2000-07-25  0:00           ` Dr. Joachim Schr�er
2000-07-25  0:00             ` Florian Weimer
2000-07-26  0:00             ` David Kristola
2000-07-25  0:00           ` Keith Thompson
2000-07-19  0:00       ` David Kristola
2000-07-18  0:00     ` Scott Ingram`
2000-07-24  0:00   ` Richard Riehle
2000-07-26  0:00     ` The Ada type model (was Re: Top 10 Language Constructs (Ada)) Marc A. Criley
2000-07-15  0:00 ` Top 10 Language Constructs (Ada) David Botton
replies disabled

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