3 ms·
In my personal experience, its quite rare outside of a few specific cases where I need unbounded loops. The specific cases where I do need them tend to be event
by dkersten 5y ago
In my personal experience, its quite rare outside of a few specific cases where I need unbounded loops. The specific cases where I do need them tend to be event loops -- a game loop, a consume the queue loop, a read and process input loop, etc, basically waiting on some external (to that code, not necessarily to the program) data, forever until the program is told to stop. Sometimes they're provided for me by some library or framework, sometimes I need to write them myself.
Almost every other case, in my own code at least, is a bounded loop. Usually processing a collection, but also often processing bounded ranges.