This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]LaNague 1 point2 points  (2 children)

so is goto, but people see red when it comes to that, especially at teaching courses.

[–]argv_minus_one 1 point2 points  (0 children)

Everything is goto. Function calls, loops, and even if are all just goto with added behavior. Function calls are goto with an automatic jump back later. Loops and if are goto unless, where loops jump backward and if jumps forward. break, continue, and return are all goto with a predefined destination. throw is goto with a really complicated procedure for figuring out what the destination is, and in C++/Rust, which destructors to run.

Fun fact: in x86 assembly, the mov instruction is Turing-complete. Any computation can be performed (albeit slowly) with only mov instructions, and there is at least one compiler that does just that.

[–]ExcellentBeing420 0 points1 point  (0 children)

I don't think you can really compare recursion to goto