Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!cs.utexas.edu!rice!uw-beaver!Teknowledge.COM!unix!hplabs!hpda!hpwala!hpavla!gary From: gary@hpavla.AVO.HP.COM (Gary Jackoway) Newsgroups: comp.lang.c Subject: Re: do...while vs. repeat...until (was: Errors aren't that simple) Message-ID: <9130009@hpavla.AVO.HP.COM> Date: 16 Mar 90 20:12:04 GMT References: <16188@haddock.ima.isc.com> Organization: Hewlett-Packard Avondale Division Lines: 19 Karl Heuer writes: > Judging from my own personal > experience, it is more natural for a test-at-top loop to specify the condition > for continuing (while), but for a test-at-bottom loop to specify the condition > for terminating (until). I don't know if there's been a study on this; in > fact, I'm not entirely sure how to formalize the concept. ---------- Bah, humbug. It is clearly more consistent to have while..do and do..while where the sense of the test works the same, than while..do and repeat..until where the sense of the test changes. If nothing else, when someone converts one form into the other, the likelihood of error is significantly reduced. And it seems to come up frequently that one has to change the test from the beginning to the end of the loop. (And vice-versa.) Gary "and I learned Pascal before C" Jackoway