Attempting to look this up, now, I discover that lots of FORTRAN doccy
seems to just say "modifying the loop counter is banned" or "would cause
great confusion" or similar
You appear to be saying that, sometimes you can, sometimes you can't.
Not a satisfactory state of affairs.
No, it wasn't. I was there: I debugged my first Fortran compiler in
machine language form. Different compilers had radically different
semantics because manufacturers wanted to call the shots. C99 returns
to these thrilling days of yesteryear, even to engaging people
innocent of comp sci to give the whole effort the right period flavor,
like fat re-enactors in Ted Turner's movie Gettysburg pretending to be
Johnny Rebs on short rations. The result? A mess.
Well, personally I use PHP and JavaScript, both of which follow the C
model.
They both suck.
Verifiable by whom or what? I tend to verify my own code.
Back to the future. In the 1970s, we learned to review code in
"structured walkthroughs" while suspending the universal
competitiveness of capitalism. Then that rat bastard Reagan got his
pimply butt elected. Now we "verify" our own code.
Bug o rama.
I "verified" my own code on the parser discussion. Ben Bacarisse sent
me the error (without recommending a solution). I realized I made the
same error I'd made when writing my book code, which I'd fixed in the
book code after discovering it through testing. I changed my solution
from one that parsed a complete expression or addFactor on the right
to one that iterated over addFactor and multFactor.
I fixed the error as far as I know. I thought of coding the solution
in C sharp to be empirically sure, but now that I've got Ben working
for me (that's a joke son) I need not.
If you faggots would stop your obscene bullying of people who seem to
be safe targets, you'd get more work done.
Zzzz zzzz - zonk!
(Cue snores of boredom)
Why is it fashionable to be bored? Just asking. Is it hip? Od just
stupid?
Oh! Has he stopped babbling now? Right. It certainly is more useful to
I'm not babbling.
be able to modify the loop counters and it's well defined what happens,
When it is useful, you can use a WHILE construct so as to notify the
code reader to watch for counter modification.
If you're writing a loop where the counter can change, a whole new set
of considerations arises as to VERIFYING whether your code works, esp.
if everybody hates you and nobody wants to review your code (I'm a
real popular guy: everybody loves to review my code. That's a joke,
son.)
The use of while signals that the loop termination condition follows.
unlike, as you say yourself, with FORTRAN (at least, up until I stopped
using it).
When writing C, you just have to learn to take care, is all, just as
with any program.
Good old patriarchal nonsense, honored more in the breach than in the
observance. Yore Daddy, as you saw him at the age of 4, never made a
mistake, and he haunts your worklife. Grow up. Because of the
complexity of software, we have known since Dijsktra that taking care
is no defense against errors. Arguably, smart people make more
mistakes when working alone. I'm an example.
The only sizeable bit of C I wrote (some 30k lines)
ran on a MicroVAX and used to run for 9 months at a time with no extra
page faults, no intervention, and no restarts. Why 9 months? Because of
the annual site-wide power outage for maintenance of the 240kV line that
supplied power to the site. So, writing reliable code with lots of
malloc() and free() usage is quite possible.
This is an elementary mistake, because "it runs, it consumes
resources, it gives answers, the user is happy" is in no way a
correctness proof. Formally, a correctness proof is a mathematical
proof from which a program can be derived. Informally, a correctness
proof is honest agreement by a group of peers, with none of their
managers present, no office politics, nobody terrorized by the threat
of loss of medical insurance, in France, that the program works.