[TUHS] I can't drive 55: "GOTO considered harmful" 55th anniversary

Ralph Corderoy ralph at inputplus.co.uk
Fri Mar 10 21:56:30 AEST 2023


Hi Arnold,

> > > after a stint in Java with its multilevel break...
> >
> > Given sh(1)'s break takes an optional number of loops to break out of,
> > I'm surprised C stuck with just the single-level break.
>
> C predates the Bourne shell by several years.

Yes, but C was evolving.  As it aged and spread in use, I agree it could
change less easily.

> Remember too that the C compiler had to fit in a small space; having
> multilevel or labelled breaks requires more bookkeeping.

Is it more bookkeeping than is already needed to handle the ends of the
nested for-loops, say?

-- 
Cheers, Ralph.


More information about the TUHS mailing list