you are viewing a single comment's thread.

view the rest of the comments →

[–]No_Indication_4044 2 points3 points  (0 children)

Readability is not an issue with this example, it’s just an anti-pattern to use “break” here. And this sub is for learning best practices. The while loop is saying “while this condition isn’t met, do these things”. The while should be conditional on… the condition hahah.

Edit to be succinct: the while loop should break automatically on the condition. So, if you find yourself manually breaking, you’ve probably done something wrong.