using break <label> instead of goto <label>

Tony Li Tli at Usc-Eclb
Mon Jan 14 09:45:02 AEST 1985


Whoa!  I'm not out to automate current design practices.  I'm much
more interested in providing a NEW design methodology whereby the
compiler (or some other entity - like lint for C) goes through and
either (1) proves your program correct or (2) derives a provably
correct program from a proof of an algorimth.

Work is currently being done on both these topics on a very small
scale, and things look quite promising except for the fact that doing
these things take mega-cycles.  Once we know enough to where we could
make things efficient, this should greatly simplify the software
design process.  Ultimately, it might be possible to have the designer
just state the goals, and let the system generate all of the code,
e.g. "Sort these numbers, and write them to tape as an ANSI file
FOO.BAR".  

The heuristics are involved when we try to generate "good" code for a
specification that has a little leeway.  Since there are lots of
possible implementations, and we don't have the opportunity to look at
all of them, we need a heuristic to help decide the implementation.

So actually, I guess that I'm in favor of giving the programmer a lot
of assistance in 'thinking logically and clearly'.  Currently, this is
a tough proposition, and is done by a very few people.  I'm hoping
that this would mean that new programmers would have to learn very few
new rules (mostly Boolean logic - that's not unreasonable, is it? ;-).
And with that, you could dispose of a lot of nitpicking rules that we
have now.

[End of digression, back to reality]

As to break <label>, I have mixed feelings.  Yes, it's a cleaner
feature than a goto.  Unfortunately it's not trivial to implement, and
it's a new feature, which means that it would wind up in C from now to
eternity, along with 'goto'.  I'm not sure that the gain makes up for
the burden on the language design.

Cheers, 
Tony ;-)



More information about the Comp.lang.c mailing list