3

Possible Duplicate:
Is there a goto statement in java?

Why is goto considered evil in Java, and why is is not suitable for use in high-level programming languages?

Community
  • 1
  • 1
  • 3
    See, perhaps, http://stackoverflow.com/questions/2545103/is-there-a-goto-statement-in-java – Jon Newmuis Dec 09 '12 at 05:59
  • Fundamentally, there's nothing wrong with GOTO. The code produced by our Java compilers (and all other compilers...) is full of conditional and non-conditional jumps AKA GOTO. However, application coders tend to be less disciplined than the compiler. It becomes easy to make code that's difficult to debug and understand. – Tony Ennis Dec 09 '12 at 06:05
  • @TonyEnnis: "Fundamentally...nothing wrong": I beg to differ: We are talking about source code. _Source Code_ is not written for the CPU alone. It is more written to other humans who must take care of the code and must understand it. There GOTO _is_ evil in the common case. _Compiled Code_ is written only for the CPU. Here GOTO is not evil, it is the way CPUs think. But on this level the abstraction of structured programming has been resolved hence the "laws" of the upper abstraction level do not apply. – A.H. Dec 09 '12 at 10:06

1 Answers1

5

The simplest answer is it makes code unmanageable and difficult to follow after it exceeds certain lines of code.

A better reason.. xkcd

Image courtesy of xkcd

vidit
  • 6,293
  • 3
  • 32
  • 50