0
comment
comment
on 2/22/2015 3:30 PM
Dijkstra wrote the following. I agree with his reasoning.
However, goto is useful in certain lower level domains.
The difficulty of reading code with goto statements is that it’s hard to follow the program flow.
The reasoning can also be applied to programming where you do not use goto.
Consider the following code:
someMethod(){
// some state
label 1:
doStuff();
goto end;
label 2:
if (condition){
goto 1;
}else{
doOtherStuff();
goto end;
}
label 3:
doSom[...]