in reply to infinite loops == bad?
Any Perl-Tk program is an infinite loop, other here have mentioned other programs that have similar properties. But I draw a line between programs that are infinite on purpose and those that are simply broken.
Best way to tell the difference? If you need to hit Control-C or use kill, pskill Xkill or Task Manager, or a similar utility to stop your program, that may be a "bad" infinite loop. Take perl Tk for example, Your "infinite" loop is listening for events, and this allows you to code a proper exit or even a shutdown sequence. That way you can close your filehandles database handles etc. Your program could listen for events or other input to figure out when to exit.
|
|---|