UMBC CS 201, Fall 05
UMBC CMSC 201 Fall '05
CSEE | 201 | 201 F'05 | lectures | news | help

goto

Background

Warning

See also

Go To Statement Considered Harmful, Edsger W. Dijkstra, Communications of the ACM, Vol. 11, No. 3, March 1968, pp. 147-148. For a number of years I have been familiar with the observation that the quality of programmers is a decreasing function of the density of go to statements in the programs they produce. More recently I discovered why the use of the go to statement has such disastrous effects, and I became convinced that the go to statement should be abolished from all "higher level" programming languages (i.e. everything except, perhaps, plain machine code). At that time I did not attach too much importance to this discovery; I now submit my considerations for publication because in very recent discussions in which the subject turned up, I have been urged to do so.

Break and Continue

The break statement

The break statement exits from a switch, while, do or for statement that it is in.

The continue statement

The continue statement starts the "next" iteration of the enclosing while, do or for.

Since both break and continue alter the natural control flow of a program, we don't allow you to use them in your loops in CMSC 201. The notable exception is that most cases of the switch should have a break statement in them.


CSEE | 201 | 201 F'05 | lectures | news | help

Wednesday, 07-Sep-2005 11:54:32 EDT