0 like 0 dislike
49 views
in Computer Science by (1.0m points)
What is the purpose of goto statement?

1 Answer

0 like 0 dislike
by (1.0m points)
The “goto” statement is one of the very essential commands in every language. It just tells the program to jump to a label, a different part of the program and commence the execution there.

It is like a function, like a call just that you don’t expect the execution to return to the original place.

The “goto” as a command was getting a lot of shit over the years but most people have learned by now, after all the “Goto considered harmful” hype of the late 60’s, that this command is essential and important and that you can’t do without it.

There are many examples, like the implementation of state machines, that is essential the goto, while I would argue it is the “on X goto A, B, C”, but that’s an other thing that’s missing in most modern languages.

Language designers were trying to get rid of it, with the result that most languages came to senses and reimplemented it.

For example Lua 5.2 did so after trying 25 years without it. And with that LuaJIT did.

Related questions

0 like 0 dislike
1 answer 35 views
0 like 0 dislike
1 answer 35 views
0 like 0 dislike
1 answer 56 views
0 like 0 dislike
1 answer 63 views
asked Nov 9, 2018 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 56 views
0 like 0 dislike
1 answer 42 views
0 like 0 dislike
1 answer 58 views
asked Nov 9, 2018 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 79 views
asked Apr 3, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
1 answer 62 views
asked Feb 14, 2019 in Computer Science by danish (1.0m points)
0 like 0 dislike
0 answers 72 views
asked Feb 13, 2019 in Computer Science by danish (1.0m points)
Welcome to Free Homework Help, where you can ask questions and receive answers from other members of the community. Anybody can ask a question. Anybody can answer. The best answers are voted up and rise to the top. Join them; it only takes a minute: School, College, University, Academy Free Homework Help

19.4k questions

18.3k answers

8.7k comments

6.3k users

Free Hit Counters
...