Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!comp.vuw.ac.nz!cc-server4.massey.ac.nz!T.Moore From: T.Moore@massey.ac.nz (T. Moore) Newsgroups: comp.lang.pascal Subject: Re: Gotos are ok (Was Re: IMPLEMENT GOTO ACROSS MODULES IN TURBO PASCAL??) Message-ID: <1991Jan17.205508.16059@massey.ac.nz> Date: 17 Jan 91 20:55:08 GMT References: <11656@j.cc.purdue.edu> <7147@tekgen.BV.TEK.COM> <11661@j.cc.purdue.edu> <1991Jan10.031015.15282@cs.mcgill.ca> <1991Jan10.122222.1013@uwasa.fi> <1991Jan16.005523.28337@syacus.acus.oz> Organization: Massey University, Palmerston North, New Zealand Lines: 38 X-Reader: NETNEWS/PC Version 2.2 >>Of course it is often desirable for the sake of clarity to avoid >>gotos, but this stigma that has been ingrained and incantated to by >>the self-chosen guards of programming purity is ridiculous. Welcome >>to the real world where programming is needed because something >>needs to be performed, and where the format of code is secondary. >>Don't confuse the ends and means. > >Sure gotos work very well. The problem is they are too powerful, and thus >subject to undisciplined use. > >care and pride in what they do. The advocates of undisciplined goto ^^^^^^^^^^^^^ >usage are undermining our progress towards this goal, a goal which I don't think you are as far apart as you think. The operative word is underlined above. If possible, a program should be tree structured which essentially means not using spaghetti code. Dijkstra first wrote about the dangers of gotos but later said that he did not intend that people elevate the idea to the staus of a religion. It is just as mindless to blindly follow a rule without thinking about the reasons for it. A more sensible rule is to only use gotos if it makes the program structure clearer. An exit statement in the language would probably eliminate most of the cases in which gotos might sometimes aid clarity. If you want to totally avoid gotos - fine. If you ocassionally use them in a tree structured manner - I don't mind If you want to write spaghetti code - that's up to you but don't blame the language designer for permitting you that freedom. -- Terry Moore Department of Mathematics and Statisics, Massey University, Palmerston North, New Zealand Kroneker: "God made the natural numbers, the rest is the work of man." Zermelo: "But I can construct the natural from the empty set alone." Bystander: "Who said 'You can't get something for nothing.'?"