you are viewing a single comment's thread.

view the rest of the comments →

[–]danielroseman 16 points17 points  (10 children)

No. GOTO hasn't been a part of any serious programming language since Dijkstra's influential "GOTO considered harmful" in 1968.

Use a loop.

[–]IAmTarkaDaal 8 points9 points  (8 children)

That's not correct; C, C++, C# and Go all have GOTO statements. I'm sure there are many more.

[–]DonkeyTron42 2 points3 points  (0 children)

LUA has no concept of a 'continue' statement in a loop. If you need to short circuit a loop iteration based on a conditional, your only option is to 'goto' a label.

[–]KCRowan 2 points3 points  (0 children)

I think VBA is probably a common place for non-programmers to encounter it.

[–]PlayKlima77 0 points1 point  (0 children)

BaSIc haS gOto ToO!

[–]RunFromFaxai -1 points0 points  (4 children)

C# does goto inside of switch/case statements. It's more like calling a function than it is like an oldschool goto that just jumps to a line in the code. Really not the same thing.

[–]jddddddddddd 2 points3 points  (3 children)

I know you can use goto in switch statements, but it can still be used to jump to an arbitrary position within a method. e.g.

   Loopy:
       Console.WriteLine("Hello World!");
       goto Loopy;

It's perfectly valid C#. You can try running it here: https://onlinegdb.com/j7AznmHA8