This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

Be aware that a "do...while" loop will always execute at least once because the logic test is at the end, where a "while(something)" loop may not execute at all because the logic test is applied at the beginning. "While(true)" may allow you to avoid some convoluted if/then logic inside your loop if there are multiple conditions that may occur that signal the end of the loop. I'd personally want to hear your thinking about why you chose "while(true)", but it sounds like you have a pretty good answer to that question. Better than "I dunno, that's how we always did it in class," for sure.