Sujet : Re: Loops (was Re: do { quit; } else { })
De : bc (at) *nospam* freeuk.com (bart)
Groupes : comp.lang.cDate : 19. Apr 2025, 11:26:11
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vtvto2$15otp$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
User-Agent : Mozilla Thunderbird
On 19/04/2025 07:27, Janis Papanagnou wrote:
On 19.04.2025 00:27, bart wrote:
So, yes, I think that is problematic, and the fault is with the
language. This stuff isn't not hard to get right; even BASIC manages to
FOR-loops properly.
As so often explained to you, BASIC has a most primitive loop.[*]
As has been so often pointed out, the vast majority of iterating loops can be accommodated by 'for i = a to b'. So in that case it is not primitive.
However C's for-loop genuinely *IS* primitve.
If that's all you can intellectually handle you're obviously a lousy
programmer (and far from a software engineer).
Do you undertand my reasons for saying what I do?
Suppose that C had both its primitive loop, and one like Basic's (or like Awk's); would that be better? If so, why?
In fact, WHY does Awk have that other kind of loop? Since the primitive form can express it just as well.
What are the advantages? Say somebody said, if you can't express a loop using C-style, and need to rely on 'for-in', then you're a lousy programmer.
Let's go the other way and say C had no loops at all, and somebody advocating for loop statements was told that if they couldn't handle 'if', 'goto' and labels, then *they* were a lousy programmmer?
Your arguments are ludicrous, sorry.
Effectively you are arguing for there to be no higher level languages, because anyone who wants them must also be incapable of understanding and using what there is.
It could be so simple; don't use "C" and all your problems are gone.
(Well, at least all your "C" related problems.)
Ha! I generally don't.
The 1% of my coding that involves actual C is enough.
If you cannot handle elementary things you should give up programming.
I've written many 10s of 1000s of lines of assembly. But I prefer HLL code, and HLL code which has some must-have fundamentals. Like a fucking loop that works.