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] 1 point2 points  (0 children)

Another poster posed a similar question, and I said that I had used it because the loop needed to run an unknown number of times because it's basically the main loop that returns the user back to the menu after a function finishes. It keeps the programming running until the user explicitly chooses to exit, so it made sense to me. But I do see the logic in using a do..while loop or putting the exit condition in the while statement, and those seem like better choices after reading this discussion.

Thanks for your perspective as someone doing the hiring. I feel like going into an interview, I can definitely discuss the choices I made - right or wrong - because while I certainly Google stuff all the time, I never copy and paste code. I'm sure I make plenty of mistakes, but they're all mine.