Talk:Infinite loop
From Wikipedia, the free encyclopedia
Contents |
[edit] Infinite loops found in society??
Wtf is the deal with this section? This article is part of the computer science wikiproject. It is not social science. 66.190.142.200 (talk) 08:11, 6 April 2008 (UTC)
- I want to point out that I just checked the "citation" Rmarkosian gives in the "infinite loops in society" paragraph. It redirects to a website he made himself. It has absolutely ZERO to do with the topic of this article and I have removed it accordingly. That is ridiculous. 66.190.142.200 (talk) 08:19, 6 April 2008 (UTC)
[edit] The example in BASIC
If a programmer were to create that 2-line example in QBASIC, QuickBASIC, or similar interpreter/compiler it would not be an infinite loop. The program would crash when it runs out of stack space. I changed it to:
DO LOOP UNTIL a <> 0
This is a more correct example, as a DO LOOP instruction will not store a location in the stack for use by the RETURN function like a GOTO call does. —Preceding unsigned comment added by 66.190.142.200 (talk) 01:05, 6 April 2008 (UTC)
[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
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.
- 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)
[edit] tight loop
Tight loop links to this article. Is it the same as infinite loop? --Abdull 08:02, 6 July 2007 (UTC)
- No. A tight loop is a loop with few instructions in the body that's executed many times (they are prime candidates for optimization). Infinite loops are often tight, but a tight loop is rarely infinite. The term "tight loop" doesn't warrant a separate article; at best it's dictionary material. The redirect isn't really appropriate, though. 82.95.254.249 15:15, 30 September 2007 (UTC)