From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,dab7d920e4340f12 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,dab7d920e4340f12 X-Google-Attributes: gid103376,public From: kennedy1@bwmail1.hcc.com Subject: Re: C is 'better' than Ada because... Date: 1996/07/26 Message-ID: <4tarqt$e46@mailgate.bridgewater.ne.hcc.com>#1/1 X-Deja-AN: 170620760 references: <31daad10.57288085@netline-fddi.jpl.nasa.gov> <31ebfbd7.330061022@netline-fddi.jpl.nasa.gov> <31EE19D1.6977@lfwc.lockheed.com> <31efe069.63062188@netline-fddi.jpl.nasa.gov> <4sopkp$dao@itfhps00.itf.hcsd.ca> <31f3c396.238311543@netline-fddi.jpl.nasa.gov> <31f4fa31.317828803@netline-fddi.jpl.nasa.gov> <4t72fl$22d@mulga.cs.mu.OZ.AU> <31f7db04.80562082@netline-fddi.jpl.nasa.gov> organization: Hoechst Celanese reply-to: kennedy1@bwmail1.hcc.com newsgroups: comp.lang.ada,comp.lang.c Date: 1996-07-26T00:00:00+00:00 List-Id: In <31f7db04.80562082@netline-fddi.jpl.nasa.gov>, kdq@emoryi.jpl.nasa.gov (Kevin D. Quitt) writes: >No, that's like C's switch statement. COBOL uses self-modifying code for >computed gotos. No it doesn't. COBOL's statement works just like FORTRAN's computed GO TO statement. (A given compiler might produce self-modifying object code to implement it; but that's neither here nor there; I have known hardware where self-modifying code was the only way to return from a subroutine.) You're thinking of the statement, which is the COBOL equivalent of a FORTRAN ASSIGNed GO TO. It is worse than the FORTRAN version, because there is no clear evidence in the GO TO that it is ever altered, aside from the fact that a paragraph consisting of only a GO TO is rare otherwise. (Also, the statement may read , in which case it is clear to the reader that an ALTER must exist.) But even that isn't as horrid as the COBOL statement, which does a goto to paragraph-1 after inserting an invisible, self-erasing goto at the end of paragraph-2. Many's the time I've hit code that took a "wild branch" when the program started a PERFORM THRU, did a GO TO out of it (perhaps aborting a bad transaction), and later, while processing a wholly separate transaction, happened to drop through to paragraph-2, where the uncancelled invisible goto was still lurking. It's contemplating stuff like this that makes me recall how COBOL almost didn't get an IF statement "because 'if' isn't a verb," or how no-one ever got around to defining the results of the COBOL statement.