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,a7f223906eb859a X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: GOTO considered necessary Date: 1997/06/08 Message-ID: #1/1 X-Deja-AN: 247035822 References: <5n977i$2cmc$1@prime.imagin.net> <5ncp5a$n1d@top.mitre.org> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-06-08T00:00:00+00:00 List-Id: Michael Brenner says <> Nope, that is wrong. People certainly disagree on the issue of whether labels/gotos or a case statement are preferable in representing FSA's, but the issue is NOT speed. Many people, including me certainly, think that it is CLEARER to express an FSA in terms of labels and gotos, because it is a clearer representation of the diagram with labels being the states, and gotos the arrows. Many excellent and experienced programmers agree with this point of view, and many do not. It is a pointless argument at this stage because nothing new is likely to be added (Michael, you are relatively new to this group, so you may not have seen previous threads on this topic). But you are quite wrong if you think the concern is about efficiency. I would prefer the representation with labels and gotos even if it were *less* efficient if I was concerned primarily about clarity. You cannot argue that one way is clearer than another here, since this is really a case of personal preference. You can argue that Michael Brenner finds the case representation clearer, and I can argue that Robert Dewar finds the label/goto form clearer, but so what? What is certainly the case is that for many (in my experience a slight, but only slight, majority) of experienced programmers, this is one of the few situations in which they feel the use of gotos is not only permissible, but indeed desirable. Two little anecdotes. Once Jean Ichbiah was looking at some code I was writing for the Alsys compiler, and expressed surprise at the use of gotos. I replied that it was a FSA, and he immediately agreed that in that case it was fine. Second, Fran Allen tells a story about one of the most experienced compiler writers at IBM using gotos extensively in the lexical scanner of a compiler. But at that time, IBM standards permitted no more than X% of source lines to be gotos, and this code required high level management approval ...