comp.lang.ada
 help / color / mirror / Atom feed
From: alex@MIMSY.CS.UMD.EDU  (Alex Blakemore)
Subject: Re: Ada Readability, Book Reference
Date: 29 Dec 92 19:35:14 GMT	[thread overview]
Message-ID: <63088@mimsy.umd.edu> (raw)

In article <9212281507.AA20416@ajpo.sei.cmu.edu> SAHARBAUGH@ROO.FIT.EDU writes:
> "Is Ada readable if you can express an indeterminate program using it?".

Any language that supports concurrency must allow indeterminate programs
to be expressed in that language.  Indeterminate order of execution of specific
 tasks
is a necessary consequence of concurrency.  The most that a language can do
is provide robust and efficient mechanisms for keeping (mostly) independent
tasks (mostly) independent - so that programmers can reason effectively about
the program's possible behavior.  Ada does this fairly well, and Ada9X is even 
better.
Ada9X also tightens the rules in several areas not involving concurrency so tha
t
program behavior is more uniformly specified (bounded) in several previous grey
 areas.

Nonetheless, IMHO you can write readable or unreadable code in any language.
Ada encourages readable software, especially with the strong division between
package interface and implementation.  Some Ada programmers actually hurt reada
bility 
by equating verbosity 100% with readability.  So a program is readable or not, 
a language
can only influence readability to a degree.  Ada excels at this, but the standa
rd that
"readability = inability to express an indeterminate program" is the wrong appr
oach.

Finally, I've recently looked at some C code that was hand translated line by l
ine
into Ada.  The C code was pretty readable and better than most - the Ada was ap
palling.
I think these are the reasons.

  1. The C standard for readability is lower.  The difference between module sp
ecs and
     implementation is much fuzzier.  Global variables are considered normal.
     So things that looked normal in C, looked appalling in Ada where I am used
     to a much more careful statement of what's an interface, what's visible et
c.

  2. The languages are different - and though some aspects of readability are
     fairly independent (use descriptive names), other idioms depend in subtle 
ways
     on the language and its culture.  Good LISP style may be bad Ada style.

  3. The human translator did not seem to know Ada well, so even when doing
     line by line translation - did not choose the best Ada constructs for doin
g
     the little things (loops instead of slice assignments for example) irregar
dless
     of being stuck with the previous decomposition into modules.

Bottom line - readability depends on many things.
-- 
---------------------------------------------------
Alex Blakemore alex@cs.umd.edu   NeXT mail accepted

             reply	other threads:[~1992-12-29 19:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-12-29 19:35 Alex Blakemore [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-12-30  3:51 Ada Readability, Book Reference Michael Feldman
1993-01-03 15:28 Orville R. Weyrich
1993-01-04  9:31 agate!spool.mu.edu!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!nobeltech
1993-01-04 17:44 Michael Feldman
1993-01-04 23:19 Tucker Taft
1993-01-05 12:55 Robert Firth
1993-01-05 16:50 agate!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.ed
replies disabled

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