Skip to main content
typos corrected (the plural is gotos, not goto's, cf. https://en.wiktionary.org/wiki/goto#English)
Source Link

Goto'sGotos are not the problem. They never were. The problem is programmers who use goto'sgotos in such a way that it makes code extremely difficult to follow, and possibly places code into an indeterminate state (remember, not every language will be as strict as C++ is). Goto's Gotos are just the gun - but the programmer is the one who points it at his foot and pulls the trigger.

In the past I've used goto'sgotos on occasions where I concluded it was the best course of action (or, more usually, the least risky course). There's nothing wrong with doing that so long as you are aware of the possible consequences. But new coders dontdon't necessarily have that sense and can make a major mess of things. So I suspect itsit's far simpler to just teach them never to use gotos.

Goto's are not the problem. They never were. The problem is programmers who use goto's in such a way that it makes code extremely difficult to follow, and possibly places code into an indeterminate state (remember, not every language will be as strict as C++ is). Goto's are just the gun - but the programmer is the one who points it at his foot and pulls the trigger.

In the past I've used goto's on occasions where I concluded it was the best course of action (or, more usually, the least risky course). There's nothing wrong with doing that so long as you are aware of the possible consequences. But new coders dont necessarily have that sense and can make a major mess of things. So I suspect its far simpler to just teach them never to use gotos.

Gotos are not the problem. They never were. The problem is programmers who use gotos in such a way that it makes code extremely difficult to follow, and possibly places code into an indeterminate state (remember, not every language will be as strict as C++ is). Gotos are just the gun - but the programmer is the one who points it at his foot and pulls the trigger.

In the past I've used gotos on occasions where I concluded it was the best course of action (or, more usually, the least risky course). There's nothing wrong with doing that so long as you are aware of the possible consequences. But new coders don't necessarily have that sense and can make a major mess of things. So I suspect it's far simpler to just teach them never to use gotos.

Source Link
GrandmasterB
  • 39.4k
  • 7
  • 84
  • 137

Goto's are not the problem. They never were. The problem is programmers who use goto's in such a way that it makes code extremely difficult to follow, and possibly places code into an indeterminate state (remember, not every language will be as strict as C++ is). Goto's are just the gun - but the programmer is the one who points it at his foot and pulls the trigger.

In the past I've used goto's on occasions where I concluded it was the best course of action (or, more usually, the least risky course). There's nothing wrong with doing that so long as you are aware of the possible consequences. But new coders dont necessarily have that sense and can make a major mess of things. So I suspect its far simpler to just teach them never to use gotos.