problems/risks due to programming language, stories requested

Lindsay Groves lindsay at comp.vuw.ac.nz
Wed Mar 14 14:46:56 AEST 1990


In article <1004 at micropen>, dave at micropen (David F. Carlson) writes:
> What break does is *very* well defined and is no more prone to
misinterpretation
> that any other non-linear control flow statement in any other PL.

A number of people in this discussion (which I haven't reached the end of yet!)
have said things like this, and appear to be suggesting that because something
is well defined there is no excuse for anyone misusing it.  I disagree
with that
and also with the second part of this statement.  There are languages in which
any kind of exit has to explicitly name the construct to be exitted -- so there
is no possiblity of consfusion about which construct the exit/break/etc.
applies
to.

> A multi-case switch is very handy in many situations to reduce identical
> treatments for similar cases.  That you ask the question of the usefulness
> of break-per-case/multiple-cases implies that you haven't sufficient
experience
> with the construct to judge its merits/weaknesses.
> 
> Dijkstra notes that no programming language can prevent a poor
programmer from
> creating bad programs.

So why aren't we all still using FORTRAN (or some older dialect)?  Why did we
all think that unlabelled CASE statements (as in Algol-W and Burroughs Algol)
were a big improvement over computed GOTOs in FORTRAN (which is basically what
the switch in C is), or that the labelled CASE statement (as in Pascal) was
a big improvement over that?  Maybe the whole of the last 30 years of work in
programming language design has been a dream!!!

Lindsay Groves



More information about the Comp.lang.c mailing list