Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!quiche!einstein From: einstein@cs.mcgill.ca (Michael CHOWET) Newsgroups: comp.lang.pascal Subject: Re: IMPLEMENT GOTO ACROSS MODULES IN TURBO PASCAL?? Message-ID: <1991Jan10.031015.15282@cs.mcgill.ca> Date: 10 Jan 91 03:10:15 GMT References: <11656@j.cc.purdue.edu> <7147@tekgen.BV.TEK.COM> <11661@j.cc.purdue.edu> Sender: news@cs.mcgill.ca (Netnews Administrator) Organization: SOCS, McGill University, Montreal, Canada Lines: 72 In article <11661@j.cc.purdue.edu> you write: >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. Well, not to flame or anything, but my background was kept "GOTO-free". I was educated (and still am) in the spirit of "good programming" (whatever *that* may be :-). And even when going through the Pascal manual I found the GOTO statement, I didn't even bother looking at how to do this. All I saw was a statement that was a throwback to my BASIC days on an Apple ][+, an Atari 400, or worse on our Commodore VIC-20. >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. I must say I wholeheartedly agree. Although you contend that sometimes goto statements are the best alternative, I have done some rather vast projects, and I have yet to encounter the need for a goto statement. Goto's can be looked at as perhaps (again, don't take offense) a lazy person's cop out. Rather than sitting own with paper and pencil to map out the logical flow of the program, one does what one feels, then adds a goto to fill in the holes... I *would* like to see these statements eliminated. >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. If indeed this is the case, have you ever thought of the following: repeat s1; s2; if not c then s3 ; until c ; >My point is, let programmers to control their own programming style. And some >"bad" practice can be the only good solution under exceptional case. Well, I *don't* think one's programming practices should be dictated by the compiler, but rather create different compilers conforming to different programming styles, and allow the programmer the choice of languages. And one should adhere to the style dictated by the compiler chosen. ============================================================================== Today's message was brought to you by the letter 'S', the number 6, and =====> Einstein@cs.mcgill.ca <==== =====> Mike CHOWET | McGill CSUS VP External <===== Post back soon, now y'hear... ==============================================================================