On 2021-09-12 10:28:22 -0700, 2qdxy4rzwzuui...@potatochowder.com wrote: > On 2021-09-11 at 18:21:17 +0100, > Alan Gauld via Python-list <python-list@python.org> wrote: > > On 11/09/2021 15:41, Peter J. Holzer wrote: > > > How is C's do/while loop more horrible than Pascal's repeat/until? [...] > > so code that has > > > > do{ > > code > > } > > while condition; > > > > Looks, for non-trivial cases, like a lot of code followed > > by an empty while loop. > > > > The do is easy to miss and the while loop disguised as > > a repeat termination is confusing. [...] > (Side question: why put the "{" next to the "do," but the "}" and the > "while" on separate lines?) > > And I would put the while on the same line as the closing brace (which > is also where I put the "else" in an if statement): > > do { > code; > } while(condition);
Me too. I also checked two C books from "þe olde times" (K&R, 1st editiion, German translation; and "A Book on C" by Kelley/Pohl) and both nestle the while on the same line as the closing brace. hp -- _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | h...@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!"
signature.asc
Description: PGP signature
-- https://mail.python.org/mailman/listinfo/python-list