[TUHS] I can't drive 55: "GOTO considered harmful" 55th anniversary

Warner Losh imp at bsdimp.com
Fri Mar 10 09:54:43 AEST 2023


Oh also sometimes for breaking out of multiple levels of while/for loops.
The alternatives are often worse.

Warner

On Thu, Mar 9, 2023, 4:31 PM Luther Johnson <luther at makerlisp.com> wrote:

> I agree, unless I use setjmp/longjmp for that. Besides error recovery,
> there are occasionally other times when we want to locally "return" to a
> common state and start "from the top" again. I find such uses very clear in
> their intent, and if commented well, not hard to follow at all - as long as
> there is not more than one "top" :)
> On 03/09/2023 04:21 PM, Warner Losh wrote:
>
>
>
> On Thu, Mar 9, 2023, 4:18 PM segaloco via TUHS <tuhs at tuhs.org> wrote:
>
>> GOTO is one of those paradoxical things where I would only trust the most
>> sophisticated engineer to know when it's acceptable to use a GOTO but on
>> the flip side would be suspicious of anyone claiming to be an engineer that
>> uses any amount of GOTOs...
>>
>> Were any of the various GOTOs in languages ever meant to be any more than
>> providing the same level of control that branch statements in assembly do?
>> Was there ever some vision anyone's aware of concerning a sophisticated,
>> dependable use of GOTOs?  Since my first days poking around learning C GOTO
>> has been mentally filed away as an assembly vestige for folks in
>> transition, not a dependable construct in its own right.  Any alternative
>> camps out there?
>>
>
>
> In C I use it all the time to do goto err for common error recovery
> because C doesn't have anything better.
>
> Warner
>
>> - Matt G.
>>
>> ------- Original Message -------
>> On Thursday, March 9th, 2023 at 3:01 PM, Steffen Nurpmeso <
>> steffen at sdaoden.eu> wrote:
>>
>>
>> > I wonder if Pink Floyd's Summer68 maybe refers to this.
>> > Other than that i am addicted and could not live without it.
>> > The other (terrible) song is from 1984 (east southern US).
>> >
>> > --steffen
>> > |
>> > |Der Kragenbaer, The moon bear,
>> > |der holt sich munter he cheerfully and one by one
>> > |einen nach dem anderen runter wa.ks himself off
>> > |(By Robert Gernhardt)
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.tuhs.org/pipermail/tuhs/attachments/20230309/7925e792/attachment.htm>


More information about the TUHS mailing list