in reply to "return" to break out of a loop

Back in the dark ages, when I was was at uni, I was taught that every programming construct should have exactly one entry and exactly one exit point1

It sucked then, and it still sucks now. return inside a loop is perfectly acceptable.

--
1Anyone else remember Jackson Structured Programming?


Unless I state otherwise, all my code runs with strict and warnings

Replies are listed 'Best First'.
Re^2: "return" to break out of a loop
by ack (Deacon) on May 14, 2008 at 03:58 UTC

    Oh, do I remember! With the same relish as I remember being beaned in the head with a chalkboard eraser by my teacher for talking in class in 3rd Grade or of being paddled in the principal's office for getting into a fight on the playground in 4th Grade. Yeh, I remember.

    ack Albuquerque, NM