Or even old loop constucts
Or even old loop constucts
Posted Jul 4, 2013 16:00 UTC (Thu) by mcmechanjw (guest, #38173)Parent article: Philosophy and "for" loops — more from Go and Rust
We still have the loop and a half problem Knuth pointed out even in this article's examples...
Elliot Soloway, Jeffrey Bonar, and Kate Ehrlich, "Cognitive
strategies and looping constructs: an empirical study" Communications
of the ACM, Vol. 26, No. 11, November 1983
showing that people overwhelmingly preferred
loop;
S;
if B then leave;
T;
again
even on a few minutes training to more classic loop constructs to solve the loop and a half class of problems and in using it did a better job
We still emulate this in C with
while(1) {
statements
if condition break;
statements
}
Which I suppose is good enough.
But will we ever see a language with a loop construct to make this natural pattern easy and clear?
