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

In most languages there are better way to do this than goto. Among them - extracting code into smaller functions (yes, state has to passed around) - exceptions (yeah yeah, hate them or love them, but if used in your environment it makes sense not to avoid them) - RAII pattern or handling cleanup, which allows simple return and "automatic" resource handling - etc.

True, in a language like C these don't apply necessarily and goto still has some use -



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

Search: