N
nmm1
"schools of thought" - this is group opinion that is inappropriate on
objective matters. If there are no scientific studies on the
ergonomics of source code readability that you can reference, you are
just speaking dogma in the manner of a religious fanatic.
Well, there are. Lots. Of course, you will have to go into a
decent library and look up journals of the 1960s and 1970s to
find them. And, no, I can't remember the references after all
this time.
Of course, those results do NOT discourage the use of heterogeneous
tuples as loop controls - the reason that those never took off is
because nobody ever worked out a simple, clean syntax for them.
In C terms, things like:
for (i = 0, ptr = base, total = 0.0;
++i, ptr = ptr->next, total += ptr.value;
i < limit && ptr != NULL && total < maximum)
But - and this is CRITICAL - where the compiler checks that i, ptr
and total are NOT otherwise changed in the loop, and where the
above usage paradigm is enforced.
Some languages have such paradigms, and Fortran has the FORALL
construct, but it is not a success for reasons other than simple
readability.
Regards,
Nick Maclaren.