problems/risks due to programming language

John F Nixon jnixon at andrew.ATL.GE.COM
Fri Feb 23 01:42:11 AEST 1990


billwolf%hazel.cs.clemson.edu at hubcap.clemson.edu (William Thomas Wolfe, 2847 ) writes:
>From jnixon at andrew.ATL.GE.COM (John F Nixon):
>>>   This is not a valid analogy.  In C, the case statement *requires* the
>>>   use of a restricted GOTO in order to accomplish "normal" processing;
>> But we aren't talking about using the "break" in this sense, we are talking
>> about using the "break" to exit an "if", something which isn't C.
>   We are talking about using a restricted GOTO to exit a control structure
>   in a normal situation.  The fact that one type of C control structure
>   requires use of a GOTO for normal exit and another type of C control
>   structure does not is a source of inconsistency and potential confusion.

Which is also present in Ada, the language designed to maximally support the
software engineering process.

The fact is that one type of Ada control structure requires use of a GOTO
for normal exit and another type of Ada control structure does not is
a source of inconsistency and potential confusion.

>>> ... C requires use [of] a dangerous construct on a routine basis.
>> Just as Ada requires the use of "exit" to leave the "loop" construct;
>> unless you use Ada'a "goto"...
>   Not true; the bare "loop...end loop" is used in situations in which 
>   the intention is for the loop to execute forever.  This arises in
>   embedded controllers, operating systems, and similar applications.  
>   If one is not writing such applications, then "while (Condition) loop"
>   and "for Control_Variable in Start..Finish loop" are normally applied. 

Then why provide the exit statement at all?  I refer you to the statements
above which describe the confusion this situation can produce.

*If* the designers of Ada had intended "loop" to be used exclusively for
forever loops, they would not have provided an "exit" from the loop.
Since they *did* choose to provide "exit", I must assume it was a deliberate
and reasoned choice which would maximally support the software engineering
process.  Given that, it is hard to ding the C use without dinging Ada use.
Therfore, there exist language constructs within Ada which "[are] a
source of inconsistency and potential confusion", or it isn't such a
terrible thing after all.

Are there plans in Ada-9X to remove the confusing "exit" construct?
(and where can one obtain the Ada-9X proposals?  I would be interested
in learnig more about the modifications to Ada)
Do you know of any other Ada constructs which are bad software
----
jnixon at atl.ge.com                    ...steinmetz!atl.decnet!jnxion



More information about the Comp.lang.c mailing list