Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
hellofunk
· 10y ago · 0 comments
The only valid use of goto I've seen is for breaking out of nested loops; a goto statement is much easier than unwinding a bunch of breaks based on arbitrary logic or flags to notify each parent loop that a break is needed.
Comments
[–]
cellularmitosis
10y ago
It's also handy for error handling / cleanup:
http://eli.thegreenplace.net/2009/04/27/using-goto-for-error...