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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,14f7200925acb579 X-Google-Attributes: gid103376,public From: Keith Thompson Subject: Re: No Go To's Forever! Date: 2000/03/21 Message-ID: #1/1 X-Deja-AN: 600694454 Sender: kst@king.cts.com References: <38D7B41D.B3494C6A@lmco.com> <38D7B83B.27DC06C8@earthlink.net> <8b93n3$8ai$1@nnrp1.deja.com> X-Trace: thoth.cts.com 953695776 98595 205.163.0.22 (22 Mar 2000 03:29:36 GMT) Organization: CTS Network Services Newsgroups: comp.lang.ada X-Complaints-To: newsmaster@cts.com Date: 2000-03-21T00:00:00+00:00 List-Id: "Ken Garlington" writes: > "Robert Dewar" wrote in message > news:8b93n3$8ai$1@nnrp1.deja.com... > > > <> > > No, the concern is not for efficiency at all! > > You're the expert, of course, but I'm surprised by this answer. I thought > that structured code in general allowed for easier determination of scope, > making certain optimizations more likely to be applied. It depends on the compiler. In the old TeleSoft compiler, certain optimizations were turned off for any scope containing a goto statement. This wasn't strictly necessary, but performing the necessary analysis would have required substantial extra time (development time, not necessarily compilation time), and it wasn't considered worth the effort. I suspect most compiler back-ends work on a lower level and are not as easily intimidated by gotos. As for stylistic concerns, IMHO gotos are very rarely appropriate. The exceptions are: to simulate a structured construct missing from the language (e.g., a multi-level break or exception handler in C, or *possibly* a continue statement in Ada), or when a goto accurately reflects the abstraction being modeled (e.g., in a finite state machine). -- Keith Thompson (The_Other_Keith) kst@cts.com San Diego Supercomputer Center <*> Welcome to the last year of the 20th century.