Sujet : Re: Loops (was Re: do { quit; } else { })
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 19. Apr 2025, 07:27:36
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vtvfop$rf2p$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/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 19.04.2025 00:27, bart wrote:
On 18/04/2025 19:10, James Kuyper wrote:
On 16.04.2025 13:01, bart wrote:
...
Unlike C's for, which is just a gimmick where you bundle three
potentially unrelated expressions and hope for the best.
>
If all you can do is "hope for the best", you're doing it wrong. It's
your job to ensure that they are not arbitrary unrelated expressions,
but correctly related expressions, and that's no different from your
responsibility for all of the other expressions that make up your
program.
If you find that problematic, you shouldn't be programming in
any language, but certainly not in C.
I see it didn't take you long to get to the personal insult. What is it
with this group?
You have been repeatedly hinted that the problems you have are
primarily on your side. You're constantly blaming the language.
You are obviously incapable of writing correct "C" code.
You still don't get it that *you* are the biggest obstacle to
your success. And that you're repeating your whining about "C"
and everything instead of stop posting tons of repetition, and
instead thinking about what's said. Or just learning the basics
would be more advantageous to you. - But you decided to continue
your nonsense instead, as we see below.
My remarks were about what C call's 'for', being a very low level
construct, even at this level of language.
Certainly not "very low" (compared, e.g., to gotos) but not as
abstract as in other HLLs; we all know that, and also explicitly
stated that many many times. Why are you to stubbornly ignoring
the facts that were written and stated.
The language will not check that those three parts are correct for the
loop you are trying to express, because there is no way for it to know
that.
Yes. Because "C" loops are different from other loop concepts. And
the "three parts" are semantically not related. Accept that if you
intend to program in "C".
So that if you do make a mistake, it can't help you, unless it fails
incidentally for some other reason. This is where you cannot rely on the
compiler, and hence my remark.
You can make mistakes in every language and in every communication
and anywhere else. - Your postings are a source of mistakes, and
the bad thing is not the mistakes; it is that you are *repeating*
your mistakes on and on.
See recent posts by JP where they used "<=" instead of "<", and by LP
where they used "N" instead of "N-1".
If you mean my post where I said "all points proven"...
I copy/pasted code from your post, but selected the wrong example.
After posting and rereading I immediately noticed that and corrected
that. - This was no "C" loop issue, it was a text copy/paste issue.
It was _my_ [copy/paste] mistake (not a "C" language design mistake).
Do you understand that? - If not try to not instantly write another
post but first take 10 minutes to understand what was written.
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.[*]
If that's all you can intellectually handle you're obviously a lousy
programmer (and far from a software engineer).
It could be so simple; don't use "C" and all your problems are gone.
(Well, at least all your "C" related problems.)
[*] And the implementations I recall also didn't get implementation
correct for use with real-valued loops. (Just BTW.)
It's a bit of a cheek to suggest that if people tend to make more
compiler-undetectable errors because C's FOR is dumb, that they should
give up programming.
If you cannot handle elementary things you should give up programming.
(Or use it for your personal purposes only and stop bothering other
people with your personal problems.)
Janis