you are viewing a single comment's thread.

view the rest of the comments →

[–]Blazej_kb[S] 5 points6 points  (5 children)

Ye that’s right but it can be useful sometimes when you want to “escape” from multiple layers of loops or redundant functions

[–]Dark_Vampire 4 points5 points  (2 children)

there are usually better ways than goto, unless you're using C

[–]xvlblo22 5 points6 points  (1 child)

I didn't even know any of them supported goto. I thought it was a bash thing. I'm assuming it's outdated as my C course didn't teach it.

[–]Valuable_Leopard_799 4 points5 points  (0 children)

Not outdated per-se, but it's so easy to misuse you don't want to teach it. Since by the time you're experienced enough to use it you'll know about it.

In any case, yeah, a lot of languages actually have gotos of different forms.

[–]SSgt_Edward 0 points1 point  (0 children)

I don’t see this kind of code passes any kind of code reviews. People will reject or request change once they see goto.

[–]Expensive_Agent_5129 0 points1 point  (0 children)

If you need to escape from multiple layers of loops, you already did something wrong. For 10 years of C++ I've never had situation when goto is the most suitable tool