Investigating Control Structures
Like in most modern programming languages, control structures in Simula have their roots in ALGOL-60/Fortran. As a result, they bear similarities to control statements found in languages such as C, C++, Java, and Pascal.
GOTO and Conditional Statements
As a descendant of ALGOL-60, Simula incorporates the GOTO statement, which wasn’t deemed harmful until 1968. In a Simula program, any line can have one or more labels. The GOTO/GO TO can transfer control to any of these labels, paving the way for “spaghetti code” that is notoriously difficult to read and maintain.
However, more than the GOTO is needed to control code execution beyond a linear or infinite-loop format. Another required structure is the conditional ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access