OK, here’s a little tidbit about me: I love lexicons. I especially love community-run lexicons. Back before wikipedia existed, dict was one of my favorite time killing applications, particularly when coupled with the Jargon File database. I’m one of those people who will look up words at the drop of a hat. Some people would call me a pedant, but I would rather think of it as a rich and healthy appreciation for the nuances of language…combined with an unhealthy need to be semantically correct.
I was chatting with an old college friend last night about healthy/unhealthy crushes. At one point it dawned on me that the unhealthy spectrum of things was the emotional equivalent of an infinite loop. Rather than processing the emotions and moving on, you just keep getting caught up on the same ones over and over. Wanting to explain programming terminology to a non-programming friend was all the excuse I needed, so I opened up wikipedia. Sure enough, the definition is like something lifted from the dialog of one of those mid-90′s dramas. Just picture the following being said in voice over, with something by, say, The Cranberries playing softly in the background and images of a character staring dejectedly into the middle distance.
Looping is repeating a set of instructions until a specific condition is met. An infinite loop occurs when the condition will never be met, due to some inherent characteristic of the loop. There are a few situations when this is desired behavior. For example, many server programs such as Internet or database servers loop forever waiting for and servicing requests, though these may not be strictly considered infinite loops, because manual program termination still serves as a condition which exits the loop. Most often, the term is used for those situations when this is not the intended result; that is, when this is a bug. Such errors are most common among novice programmers, but can be made by experienced programmers as well, and their causes can be quite subtle.
But wait! It gets better! Observe: Multi-Party Loops
Although infinite loops in a single program are usually easy to predict, a loop caused by interaction of several entities is much harder to foresee. Consider a server that always replies with an error message if it does not understand the request. Apparently, there is no possibility for an infinite loop in the server, but if there are two such servers (A and B), and A receives a message of unknown type from B, then A replies with an error message to B, B does not understand the error message and replies to A with its own error message, A does not understand the error message from B and sends yet another error message, and so on ad infinitum.
That’s pretty deep, right there.
Leave a comment