Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #162404
| From | Bart <bc@freeuk.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: I have a confession to make... |
| Date | 2021-08-16 17:48 +0100 |
| Organization | A noiseless patient Spider |
| Message-ID | <sfe4sk$7jm$1@dont-email.me> (permalink) |
| References | <sfc03t$r91$1@dont-email.me> <f5f0f455-3d5a-423b-8624-056999529dc6n@googlegroups.com> <87y291v83n.fsf@bsb.me.uk> |
On 16/08/2021 14:21, Ben Bacarisse wrote:
> Mark Bluemel <mark.bluemel@gmail.com> writes:
>
>> On Sunday, 15 August 2021 at 22:14:48 UTC+1, Vir Campestris wrote:
>
>>> I therefore have 3 nested loops: centre value, X and Y coordinates.
>>>
>>> And if I don't like the result I jump out of the X Y loops. Which is
>>> where I have that goto.
>>
>> I gave up "goto" in the late 1970s, when I was programming in
>> COBOL. Our in-house coding standards had Section and Paragraph names
>> which reflected depth in the call hierarchy - paragraphs could have
>> names like C-100, CA-100, CBA-100. The risk of typos ("GO TO CA-100"
>> when you meant "GO TO CAA-100") and the general inelegance of it all
>> led me to give up on "GO TO".
>
> Grim. I, too, last used a GOTO in the late 70s when my job was fixing
> bugs in FORTRAN code, mostly written by science subject specialists in
> the course of their research. By the time I saw the code it was usually
> hundreds of lines (well, cards) or tangled loops. Every GOTO had
> probably seemed like a good idea at the time, but the cumulative effect
> resulted in a program that even he author could not understand. It put
> me off for life.
>
> Dijkstra was writing in the era. Had the worst abuse of a GOTO been a
> jump to a common exit block in a function or breaking out of a nested
> loop, I doubt we'd have the polemic we now have. I'd prefer cleaner
> language construction such as named loops (for break), final blocks in
> functions and, maybe, co-routines or generators for the few other very
> rare use cases.
>
> That said, I've still never had to use one. I use the fact that I want
> one to prompt me to think if I've got the code wrong and, so far, I
> always decide I have.
I also used to write Fortran (IV). You necessarily had to use gotos, but
it didn't put me off them at all. I accepted that the languages I used
later had better structured statements so most of the need for them in
Fortran disappeard.
But I still used them /as needed/.
At present, I use them heavily in C source which has been generated from
linear bytecode, where program structure is only represented with
branches. Hence, the matching C code uses lots of gotos too. However no
one needs to ever see that code.
What is important is that the language allows it. Many languages now
don't have it, which means they are considerably more difficult to use
from code generators.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
I have a confession to make... Vir Campestris <vir.campestris@invalid.invalid> - 2021-08-15 22:14 +0100
Re: I have a confession to make... Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-08-15 14:44 -0700
Re: I have a confession to make... Thiago Adams <thiago.adams@gmail.com> - 2021-08-15 15:56 -0700
Re: I have a confession to make... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-08-16 01:50 +0100
Re: I have a confession to make... Bart <bc@freeuk.com> - 2021-08-16 00:18 +0100
Re: I have a confession to make... DFS <nospam@dfs.com> - 2021-08-15 20:31 -0400
Re: I have a confession to make... David Brown <david.brown@hesbynett.no> - 2021-08-16 08:20 +0200
Re: I have a confession to make... "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-08-15 23:21 -0700
Re: I have a confession to make... Vir Campestris <vir.campestris@invalid.invalid> - 2021-08-17 21:43 +0100
Re: I have a confession to make... Mark Bluemel <mark.bluemel@gmail.com> - 2021-08-16 00:32 -0700
Re: I have a confession to make... Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-08-16 14:21 +0100
Re: I have a confession to make... Bart <bc@freeuk.com> - 2021-08-16 17:48 +0100
Re: I have a confession to make... Tim Rentsch <tr.17687@z991.linuxsc.com> - 2021-09-06 06:30 -0700
Re: I have a confession to make... David Brown <david.brown@hesbynett.no> - 2021-09-06 18:04 +0200
csiph-web