I often use this code pattern:
while(true) {
//do something
if() {
break;
}
}
Another progr
It depends on what you’re trying to do, but in general I prefer putting the conditional in the while.
I’d use a while(true) loop if I was writing a daemon or other process that should run until it gets killed.