Ironically the Scala break in scala.util.control.Breaks
is an exception:
def break(): Nothing = { throw breakException }
The best advice is: DO NOT use break, continue and goto! IMO they are the same, bad practice and an evil source of all kind of problems (and hot discussions) and finally "considered be harmful". Code block structured, also in this example breaks are superfluous. Our Edsger W. Dijkstra†wrote:
The quality of programmers is a decreasing function of the density of go to statements in the programs they produce.