Why use infinite loops?

前端 未结 14 2242
轮回少年
轮回少年 2021-02-08 13:33

Another poster asked about preferred syntax for infinite loops.

A follow-up question: Why do you use infinite loops in your code? I typically see a construct like

14条回答
  •  忘掉有多难
    2021-02-08 13:54

    Finite state machines. They're not supposed to end until you reach an end state, at which point you break or return.

提交回复
热议问题