Talk:Infinite loop

From Wikipedia, the free encyclopedia

This article is within the scope of WikiProject Computer science.
??? This article has not yet received a rating on the assessment scale.
??? This article has not yet received an importance rating on the assessment scale.

Contents

[edit] What a joke!

The joke here (for the non-computer-programmer) is that infinite loop links to endless loop which links to infinite loop which links to endless loop which links to infinite loop which links to endless loop which links to infinite loop which links to endless loop which links to infinite loop which links to endless loop which links to infinite loop which links to endless loop which links to infinite loop which links to endless loop which links to infinite loop which links to endless loop which . . .

yes that's funny, but at the same time, not particularly helpful... sorry. Wesley
Can't there be any jokes in the Wikipedia? Sheesh! (I won't un-revert if someone de-humorizes them.) User:Ed Poor
There are Jokes in Wikipedia, as well as humour, laughs, fun and even Sheesh!

But surely they are not the same thing.

I suggest that:

  • An endless loop is any loop that connects back to its self with no way of getting out.
  • An infinite loop is a loop constructed of an infinite number of instructions and therefore only loops back after an infinite amount of time, or, more practically, never.

user:Perry Bebbington

I've never heard infinite loop used to mean this. I've always heard infinite loop used in the meaning above for endless loop: it is defined this way in the Jargon Lexicon at http://www.tuxedo.org/~esr/jargon/ endless loop does not appear there. -- Olof



Thank you, Axel and Lee. It looks just about finished now. User:Ed Poor, unoffical "spirit of Larry"


Fair enough. user:Perry Bebbington

[edit] Misnomer.

I'm actually a little tiny bit surprised that there is no mention that this is technically a misnomer. For something to be infinite, it must be growing without bounds. I have yet to see a program loop that "grows" let alone increases the rate of growth. Additionally, these loops all terminate - if nothing else, the programmer will pull the plug on the machine; the loop will stop. --Connel MacKenzie 06:24, Apr 6, 2005 (UTC)

Kind of a bizarre over-interpretation of the words, so not surprising no one would mention it. Also, only possible to "pull the plug" on a physical machine; the concept applies to theoretical constructs such as Turing machines, no plug-pulling there. Stan 14:09, 6 Apr 2005 (UTC)
In a theoretically exact implementation, the time required to execute the loop is infinite Superm401 01:55, Apr 14, 2005 (UTC).

[edit] Recursion unimportant?

Infinite recursion redirects to infinite loop. A combined discussion might be useful, but there isn't anything about recursion there at all. Similarly, stack overflow (the result of infinite recursion!) redirects to buffer overflow, which is unreleated (although buffers that overflow onto the stack could be called a stack overflow, that's not the only kind of stack overflow). Is there some reason that there's no discussion of the subject at any of the expected places? Is infinite recursion considered insufficiently notable when divorced from other problems? --Tardis 01:09, 4 May 2005 (UTC)

[edit] Impossible Termination Condition

Your example of an interminable for loop seems wrong to me, why would the loop count up at all when the condition is met right in the declaration? i is greater than 0 immediately because it had been assigned the value of 1, so it should theoretically never commence its iterations.

In actionscript, for loops declared as you describe just never get started. Is this 'unsigned int' is C specific functionality (I am not familiar with C)?

[edit] Infinite recursion rewrite

Technically, an infinite loop can only occur in iterative programming, which is programming that repeats itself until some condition is met. However, infinite recursion can occur in recursive programming, and an infinitely recursive sequence can be seen as a pseudo-infinite loop. Recursive functions operate by solving part of a problem, then calling on themselves to solve the rest. For example, a recursive function to sum the numbers up to a number n might add n to the sum of the numbers up to n-1. The way this process ends is with a special case. In this situation, for instance, if n were 1 the function would return 1. It is possible to create infinite recursion by failing to have that ending condition, meaning the function theoretically calls itself forever. (It would actually run out of stack space.) Recursion is perfectly safe with an adequate ending condition.

I rewrote this. The distinction given between infinite loop and infinite recursion above isn't exact (see "LAMBDA: The Ultimate GOTO" by Guy Steele). I used the same example (plus a more trivial one), but with code. --Mgreenbe 13:41, 23 January 2006 (UTC)

[edit] This should...

... null result. -- Chris 18:14, 5 November 2006 (UTC)