Path: utzoo!attcan!uunet!olivea!decwrl!sdd.hp.com!caen!umich!sharkey!tygra!dave From: dave@tygra.UUCP (David Conrad) Newsgroups: comp.lang.pascal Subject: Re: Goto's are okay Summary: ...but just barely Keywords: goto Message-ID: <1991Jan28.102509.5587@tygra.UUCP> Date: 28 Jan 91 10:25:09 GMT References: <2427@bnlux0.bnl.gov> <1991Jan27.074528.23487@tygra.UUCP> <1991Jan27.185044.19856@uwasa.fi> Organization: Moore Software, Detroit, MI Lines: 50 In article <1991Jan27.185044.19856@uwasa.fi> ts@uwasa.fi (Timo Salmi) writes: >In article <1991Jan27.074528.23487@tygra.UUCP> I write: >: >>I hope you see what I'm getting at. All structured programming constructs >>can be emulated with goto's, and can be thought of etc. But they have the >>advantage that the compiler does the work for you so you can't screw it up >>by adding/subtracting lines. That's the difference between structured and >>spaghetti code. >: > >I may be misinterpreting your implication, but as the guilty party >of commencing the debate, let me again point out > >repeat > using gotos != spaghetti code > not using gotos != writing well structured programming > careless usage of gotos = spaghetti code >until false > Well, yes, you did misinterpret, but it's probably my fault for not being clear enough. I don't think that goto's mean automatic spaghetti code, I just think they are unnecessary and *usually* lead to spaghetti code. The spaghetti code I meant was when the adding/subtracting lines starts to screw up the original intent. Then your talkin' serious pasta. One can write bad code in any language, and one can also do structured programming in any language. A (possibly) amusing example: I was working on an accounting application in COBOL (Ak! Gasp!), and another programmer on the project was a mainframe COBOL programmer from way back who didn't know pascal. Well, halfway through the project I started teaching him Turbo Pascal in our spare time because he wanted to know what this great thing was that I'd been using to write little utilities for the project. (Like an editor that called up the COBOL compiler...Turbo Editor Toolbox!) After he had learned some pascal he looked at the COBOL programs I'd been writing and he said (and I don't remember his exact words), "You know, you write COBOL just like pascal," or, "You make your COBOL programs look like pascal," or something. -- David Conrad dave@ddmi.com -- = CAT-TALK Conferencing Network, Computer Conferencing and File Archive = - 1-313-343-0800, 300/1200/2400/9600 baud, 8/N/1. New users use 'new' - = as a login id. AVAILABLE VIA PC-PURSUIT!!! (City code "MIDET") = E-MAIL Address: dave@DDMI.COM