top | item 10413725

(no title)

AUmrysh | 10 years ago

In many high level languages a break, continue, pass, that sort of thing (where you want to skip or escape a loop iteration) is usually implemented with a goto as well.

Also, a common use of goto in C is when you're doing something in nested for loops and want to break out of all of them. A goto is actually much cleaner here than using sentinel values or boolean flags, or naughty things like setting your loop variables to be outside of the conditional bounds.

discuss

order

masklinn|10 years ago

Well if you go that way, fundamentally all structured programming techniques are implemented with a goto, that's what jumps are.