Sujet : Re: do { quit; } else { }
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 14. Apr 2025, 23:07:00
Autres entêtes
Organisation : None to speak of
Message-ID : <87tt6q2y9n.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Gnus/5.13 (Gnus v5.13)
bart <
bc@freeuk.com> writes:
[...]
Some of this is to be expected: if they started off using brace
syntax, then their language will use braces. But some of the things
they copy are odd, like this for-loop from JS:
>
for(let i = 1; i <= 36; i++) {
>
Is it that hard to provide a proper for-loop where you don't have to
spell out every single detail? Fortran managed it in the 1950s!
No, it's not that hard. Nobody said it was.
You don't really believe that language designers have adopted
C-style for loops because the alternative is too hard.
C-style for loops are extremely flexible, in ways that have been
discussed at great length. The authors of the C language could
easily have added another kind of loop, but deliberately chose
not to. Most of us either agree with that decision or don't care
enough to complain about it.
You don't like C-style for loops. I agree 100% -- you don't like
C-style for loops.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */