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

I stopped reading when he recommended if-goto.


Usage of goto is fine (the effects are easily understood) when the destination only points to lines ahead of the goto, within the same block.

In this case, it makes the control flow more readable.

http://www.kerneltrap.org/node/553/2131


What if it were called "try/finally" instead?


I read the comments just expecting yours. Something must obviously bad if Dijkstra says so, right? We don't have to think for ourselves anymore if the god of CS himself has banned something, right?


Sure, goto was abused, but it's no worse than (or even better than) using continuations or using break and continue.


Any of those mysterious jump-to-somewhere-else code features resemble goto. Not that I don't think they clean up some nesting issues, but they're pretty much the same thing as goto.


Too bad, because it's the only sensible advice in the whole post.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: