UMBC CS 201, Fall 06
Fall '06

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




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'06 | lectures | news | help

Sunday, 10-Sep-2006 14:58:16 EDT