3 ms·
> code that has to be more convoluted to put the exit at the top of bottom Note I said only way out. The point is that if "the" (intended) exit can't reasonabl
by nknighthb 12y ago
> code that has to be more convoluted to put the exit at the top of bottom
Note I said only way out. The point is that if "the" (intended) exit can't reasonably be in the loop condition, then adding an escape hatch to have a second way out is useful.
Assuming C you can even just compress the whole thing to a for_x_tries(n) macro.
> What if the escape hatch triggers to early?
You'll get a helpful message and can bump the count. Easily-isolated errors are preferable to frozen/DoS'd systems.