I am trying to understand the concept behind the for loop example
for (;;)
{
//write code
}
I understand what it does and how it\'s the sa
There are a few situations when this is desired behavior. For example, the games on cartridge-based game consoles typically have no exit condition in their main loop, as there is no operating system for the program to exit to; the loop runs until the console is powered off.
Another example is when a module listen actions from another. It will need to listen all the time, so the listener have to listen for infinite time or until the program turn off. Like Sockets, Threads and UIComponents.
There isn't bad practice on the concept of infinite loop, but if it isn't wanted or prejudice your system's feature it can be considered, like when you create an unintentional infinite loop or lose program control for the loop.
To make the infinite loop a good practice:
for(;;) or while(true). Avoid tautologies in expression, do it simple!