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

Phil Budne phil at ultimate.com
Sat Mar 11 02:30:02 AEST 2023


ron at ronnatalie.com wrote:
> Multilevel breaks are as bad as goto with regard to structure violation.

Back when I was in compilers (so long ago, that it was the DEC PDP-10
FORTRAN compiler(*)) my recall is that break/continue never generated
irreducible flow graphs, as goto can:

https://en.wikipedia.org/wiki/Control-flow_graph#Reducibility

I still remember the days when you could find C code written by PASCAL
programmers, littered with condition variables on loops, and if
statements to not execute the tail of the loop body if the loop
condition was false.

(*) The FORTRAN compiler was written in BLISS-10, which had labeled
statements, and a "leave <label>" construct which was only legal
inside the labeled statement:

http://www.bitsavers.org/pdf/dec/pdp10/TOPS10/DEC-10-LBRMA-A-D_BLISS-10_Programmers_Manual_Ver_4_Feb74.pdf#page=42


More information about the TUHS mailing list