You can have a non-infinite loop without a break statement, you just need a return statement in it. Also for(;;) is much faster to write than while(true).
Yes, but the latter is easier to read. I know what the former is, but my colleague could definitely use additional brain cells. And if they don’t understand it, I’ll be the one explaining. That’s also the reason for not using abbreviations besides the most common ones in variable names. Always assume your code will be read by a typewriter monkey.
You can have a non-infinite loop without a break statement, you just need a return statement in it. Also
for(;;)is much faster to write thanwhile(true).Yes, but the latter is easier to read. I know what the former is, but my colleague could definitely use additional brain cells. And if they don’t understand it, I’ll be the one explaining. That’s also the reason for not using abbreviations besides the most common ones in variable names. Always assume your code will be read by a typewriter monkey.