Liste des Groupes | Revenir à cl c |
bart <bc@freeuk.com> wrote:What about when you're working with other people's code? Every for-loop you encounter is a little puzzle that you have to decode to find out its category! (There are about 4 categories plus 'free-style'.)On 19/04/2025 20:22, James Kuyper wrote:There is low probablity of writing standard loop wrong and mostOn 4/19/25 12:36, Kaz Kylheku wrote:>On 2025-04-19, Scott Lurndal <scott@slp53.sl.home> wrote:...bart <bc@freeuk.com> writes:On 18/04/2025 19:10, James Kuyper wrote:>>>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 inany 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?
It's not an insult, it is a simple fact.
It's not a fact that someone who finds tools problematic shouldn't
be using them.
I wasn't talking about him finding the tools problematic. I was talking
aobut him find it difficult to ensure that the expressions are not
arbitrary unrelated expressions, but are in fact correctly related
expressions. If you cannot ensure that A, B, and C have the correct
relationship to make for(A; B; C) work as needed, then you also lack to
ability to make sure that the expressions in {A; B; C:} work together as
needed, and that ability is fundamental to computer programming.
In other words, the feature is dumb.
>
The compiler cannot do any checking: for (i=0; i<n; ++n) is fine.
>
Even in BASIC, if I do this:
>
for i=1 to n
next n
>
it will say that n does not match. And here it is optional; in C that
part is necessary.
>
So, BASIC's for-loop is less dumb that C's.
>
But, you have a bizarre take on this: if somebody calls it out, then
rather than agree with them, you will personally insult the person who
said it, and suggest that if they are incapable of such a simple check,
then they shouldn't be coding.
>
The fact is that people make typos (obviously, not you or JP or SL or
KT!), and here you would really prefer that the compiler could report
them, but with this feature, it often can't.
people are not bothered that some errors are not detected at
compile time. If you are trouble by this, solution is simple:
do not write 'for' loops different than the simple one:
If you are bothered that other people do not think that CI don't now think think there is any argument that will make any difference. People here genuinely think that writing:
flexibility is a problem, then you would need _much_ stronger
argument, starting with some real data.
Les messages affichés proviennent d'usenet.