4 ms·
All those different languages might support the goto statement, but what programmer in his right mind would dare to use it? http://xkcd.com/292/ http://xkcd.com
by NameNickHN 15y ago
All those different languages might support the goto statement, but what programmer in his right mind would dare to use it? http://xkcd.com/292/ http://xkcd.com/292/
- batista 15y agoI can tell you what programmer would NOT dare use it: a programmer that doesn't bother understand programming and when each feature can be used, and instead relies on conventional wisdom and old wives tales (sometimes called "voodoo programming") to tell him what is acceptable and what is not. Notice how the guys repeating the "goto is evil" mantra, like they guy in this thread: http://kerneltrap.org/node/553/2131 http://kerneltrap.org/node/553/2131 are young as it's highly improbable that they ever had to deal with actual goto spaghetti code. So they just repeat what they heard somewhere. This guy, e.g writes: However, I have always been taught, and have always believed that "goto"s are inherently evil. They are the creators of spaghetti code (you start reading through the code to understand it (months or years after its written), and suddenly you jump to somewhere totally unrelated, and then jump somewhere else backwards, and it all gets ugly quickly). This makes later debugging of code total hell. Which, as I read it is clear that he has never actually witnessed in real life the kind of code he worries about ("I have always been told", "I have always believed" etc != "I know from experience"). I consider this more embarrassing than using goto.
- NameNickHN 15y agoThere are things in life that one doesn't has to try in order to know that they are bad.
- batista 15y agoYes. But there is nothing like those in programming, math, painting, etc. And even if it where, goto wouldn't be one of them.