Tech moves fast! Stay ahead of the curve with Techopedia!
Join nearly 200,000 subscribers who receive actionable tech insights from Techopedia.
An infinite loop is an instruction sequence that loops endlessly when a terminating condition has not been set, cannot occur, and/or causes the loop to restart before it ends.
An infinite loop is also known as an endless loop.
There are times when a programmer intentionally creates an infinite loop. For example, any form object can wait indefinitely for a user action. When an exit condition is not included within the main loop, the loop runs until the application is exited. In this case, the entire form thread is forced to end programmatically. The term infinite loop is only used in situations where the loop condition is not purposely set. These situations occur most commonly with new developers.