comp.lang.ada
 help / color / mirror / Atom feed
* Answering an Ada/COBOL Question
@ 1999-11-12  0:00 Richard D Riehle
  1999-11-13  0:00 ` Brian Rogoff
  1999-11-15  0:00 ` Joseph P Vlietstra
  0 siblings, 2 replies; 30+ messages in thread
From: Richard D Riehle @ 1999-11-12  0:00 UTC (permalink / raw)


David Glessner wrote:

Richard D Riehle wrote:
> Yes, indeed. The COBOL version of a case statement is still the
> most elegant design of multiway selection I have seen in any
> language.  Also, COBOL has adopted some ideas from Ada, although
> the COBOL users don' realize it.

Care to elaborate for us non-COBOL-aware folks?

As briefly as possible, here goes:

COBOL uses the word "Evaluate" instead of "case".  There are several
variations in syntax.  I will not cover all of them.  Instead, the one
that is interesting to me is the "decision table" version.  Also, I will
code this in a format that does not include some of COBOL's syntactic
sugar so it is easy to read.

      Evaluate A also B also C
         when True also True also True
              Perform ... end-perform
         when True also True also False
              Perform ... end-perform
         when False also True also False
              Perform ... end-perform
         when others
              Perform ... end-perform
      End-Evaluate

Note the ease with which one can map a decision table directly to
the code.  One can argue that this _can_ be expressed just as well
in some other language, perhaps Ada.  However, the question is never
"Is it _expressible_ ?" The real issue is whether how well it can be
expressed.  It is _expressiveness_ rather than _expressibility_.   

For the kinds of business data processing problems COBOL is intended to
solve, for reducing the communication gap between the client and the
programmer, the invention of the Evaluate statement and its variations has
improved the level of expressiveness.  

I once challenged some Ada programmers to come up with an Ada design 
that would be as expressive as the Evaluate statement.  None of the
solutions was satisfactory.  If you think you have a solution that is
as expressive as that in COBOL, be sure you cover all the variations
possible, not simply the one I just demonstrated.  

Richard Riehle
http://www.adaworks.com




^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~1999-11-22  0:00 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-12  0:00 Answering an Ada/COBOL Question Richard D Riehle
1999-11-13  0:00 ` Brian Rogoff
1999-11-14  0:00   ` Robert Dewar
1999-11-13  0:00     ` Brian Rogoff
1999-11-14  0:00       ` Robert Dewar
1999-11-14  0:00         ` Brian Rogoff
1999-11-15  0:00           ` Richard D Riehle
1999-11-15  0:00             ` Brian Rogoff
1999-11-16  0:00               ` Erlang (Was Re: Answering an Ada/COBOL Question) Vladimir Olensky
1999-11-16  0:00                 ` Vladimir Olensky
1999-11-17  0:00                   ` Samuel Tardieu
1999-11-19  0:00                     ` Robert Dewar
1999-11-22  0:00                       ` Samuel Tardieu
1999-11-22  0:00                         ` Brian Rogoff
1999-11-17  0:00                 ` Samuel Tardieu
1999-11-18  0:00                   ` Robert Dewar
1999-11-19  0:00                     ` Vladimir Olensky
1999-11-19  0:00                   ` Vladimir Olensky
1999-11-16  0:00               ` Answering an Ada/COBOL Question Robert Dewar
1999-11-16  0:00             ` Robert Dewar
1999-11-16  0:00               ` Richard D Riehle
1999-11-18  0:00                 ` Robert Dewar
1999-11-18  0:00                   ` tmoran
1999-11-19  0:00                     ` Robert I. Eachus
1999-11-18  0:00                   ` Marin Condic
1999-11-19  0:00                     ` Robert Dewar
1999-11-19  0:00                       ` Marin Condic
1999-11-19  0:00                         ` Robert Dewar
1999-11-15  0:00 ` Joseph P Vlietstra
1999-11-15  0:00   ` Robert Dewar

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