you are viewing a single comment's thread
view the rest of the comments
[–] 4 points 1 year ago (1 child)

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).

  • source
  • hideshow 1 child comment
  • 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.

  • source
  • parent