Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!mips!news.cs.indiana.edu!news.nd.edu!mentor.cc.purdue.edu!j.cc.purdue.edu!brazil.psych.purdue.edu!zhou From: zhou@brazil.psych.purdue.edu (Albert Zhou) Newsgroups: comp.lang.pascal Subject: Re: IMPLEMENT GOTO ACROSS MODULES IN TURBO PASCAL?? Message-ID: <11661@j.cc.purdue.edu> Date: 7 Jan 91 08:32:12 GMT References: <25404@adm.brl.mil> <11656@j.cc.purdue.edu> <7147@tekgen.BV.TEK.COM> Sender: news@j.cc.purdue.edu Reply-To: zhou@brazil.psych.purdue.edu (Albert Zhou) Organization: Purdue University Lines: 33 Any other solutions so far I've seen need quite a little extra work than if a direct goto statement can be implemented. Turbo Pascal doesn't have to disable cross-module goto to enforce "good programmin practice". Rather, it could let programmers to make choice, because under exceptional cases such goto's are the only best solutions. This reminds me of the suggestion made by some researchers to eliminate goto's altogether. Personally, I don't promote using goto's even within a block. Instead of using: repeat s1; s2; if c then goto out; s3; until forever; out:; I use: repeat s1; s2; s3; until c; However, in rare cases, s3 can be very time-consuming and by using the first code, one can save the time to execute s3 when c is true. My point is, let programmers to control their own programming style. And some "bad" practice can be the only good solution under exceptional case. Or a compiler directive (see G+) can be setup to enforce the rule of using goto directly. Just like range check.