Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is this one of those rare cases where using a goto would be reasonable?


The main case I ever found was implement missing language features. E.G.

break 3; // Break 3 levels up

break LABEL; // Break to a named label - safer-ish than goto

goto LABEL; // When you have no other option.

Usually for breaking out of a really deep set of loops to an outer loop. Such as a data stream reset, end of data, or for an error so bad a different language might E.G. throw an error and usually die.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: