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
| This article is rated Start-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||
| The content of Alderson loop was merged into Infinite loop. The former page's history now serves to provide attribution for that content in the latter page, and it must not be deleted as long as the latter page exists. For the discussion at that location, see its talk page. |
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)
Perhaps this section is here because it a study of systems, and systems in and of themselves are not limited to CS. — Preceding unsigned comment added by 66.162.159.254 (talk) 19:30, 8 July 2014 (UTC)
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)
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 . . .
But surely they are not the same thing.
I suggest that:
Thank you, Axel and Lee. It looks just about finished now. User:Ed Poor, unoffical "spirit of Larry"
Fair enough. user:Perry Bebbington
It seems fair game to link them to each other, it is not like the article was deleted to just include the other link! —Preceding unsigned comment added by Bennyj600 (talk • contribs) 21:54, 27 April 2009 (UTC)
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)
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)
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)
... null result. -- Chris 18:14, 5 November 2006 (UTC)
Tight loop links to this article. Is it the same as infinite loop? --Abdull 08:02, 6 July 2007 (UTC)
Is there any standard/provable practices for avoiding and/or detecting infinite loops in a system? Can a check be made to the effect of "is this instruction causing an infinite loop? Or is that perhaps, on the contrary, theoretically impossible due to the halting problem? If so, a link and a blurb about how this problem relates to infinite loops would be useful. —Preceding unsigned comment added by 83.89.0.118 (talk) 12:56, 27 July 2008 (UTC) I see now that there is actually a very brief paragraph linking to the halting problem. I still think it would be nice if it was featured more prominently. —Preceding unsigned comment added by 83.89.0.118 (talk) 13:02, 27 July 2008 (UTC)
...it has been done so many times because it is funny and encyclopedic. This page is surely an exception to the "no self-links" rule, which is overwritten by the democratic rule of Wikipedia (the number of people wanting to add the link is greater than the number of people wanting to remove it). Please tell us why this argument is invalid or I'll add the link. ··gracefool☺ 10:21, 10 July 2009 (UTC)
I added one that is a perfect infinite loop, correct? —Preceding unsigned comment added by Segiddins (talk • contribs) 00:55, 19 July 2009 (UTC)
Is it considered bad form to use while ( true )? E.g.,
while ( true ) {
if ( $foo->bar () ){
return;
}
}
This is a simplistic example since here one could just as easily use
while ( !$foo->bar () ) {}
However, I'm sure we have all run into situations in which it was tempting to use a while ( true ), but is it bad form? Tisane talk/stalk 15:33, 16 June 2010 (UTC)
int main()
{
while(1)
{
/* do your main program loop in all its complexity*/
if(exitCodeReceied)
break;
/*Do even more*/
}
}
while(true) is useful. In such cases I find it is generally useful to add a comment noting where I expect the loop to terminate, eg:int main()
{
while(1) // ... until break when exitCodeReceived
{
/* do your main program loop in all its complexity*/
if(exitCodeReceived)
break;
/*Do even more*/
}
}
for(;;) {The image has nothing to do with the subject matter of the article, leading to confusion. There is an article on the street, this image does not belong here. —Preceding unsigned comment added by 142.103.72.44 (talk) 16:57, 14 July 2010 (UTC)
Alderson loop is a short article should be merged here. The loop is nothing special, it's just a common type of infinite loops and there is no reason to keep it as a separate article. Zakhalesh (talk) 17:40, 19 February 2011 (UTC)
No opposing opinions, so I'll get on with the merge. Zakhalesh (talk) 10:33, 26 February 2011 (UTC)
Done. Improve the section if you wish! Zakhalesh (talk) 10:56, 26 February 2011 (UTC)
This should be redirected to Infinite loop. Ten Pound Hammer, his otters and a clue-bat • (Otters want attention) 01:58, 15 April 2011 (UTC)
A humorous example of an infinite loop in Java:
for ( ; ; )
{
System.out.println("Alice: When are you going to stop looping?");
System.out.println("Bob: Just one more time!");
}
Maybe we could include it, but IDK what section. Thanks! 68.173.113.106 (talk) 21:46, 3 February 2012 (UTC)
while(true) {}The C example in section 1.2.1 has undefined behaviour, as the int variables will eventually overflow; on a typical non-optimizing compiler the loop will terminate. TimothyEBaldwin (talk) 18:06, 10 February 2012 (UTC)
...are just very long loops? This is so scientific. Long in code? Long in execution? Does someone call a long loop pseudo-infinite? --91.50.196.105 (talk) 19:04, 11 April 2012 (UTC)
The example of an "Alderson loop," near the end of the article, is not an endless loop at all. It's fairly simple to see that if (as the comments) say, the first section of the 'if' block never executes, then the 'else' block (and therefore the 'break' statement) always executes. Am I misunderstanding the intention of the section, or is that code just plain wrong?
If I'm not misunderstanding, the author's intention was this:
while (true) {
printf("Input a number to add to the sum or 0 to quit");
i = getUserInput();
if (!(i * 0)) { // if i times 0 is false, add i to the sum
sum += i; // always executes; the condition should read (!(i == 0))
} else {
break; // terminate the loop; exit condition exists but is never reached
}
}
Alex Heinz (talk) 16:54, 5 September 2012 (UTC)
This sentence clearly refers specificly to Undecidable problem that is a subcategory of the decision problem and not to decision problems in general, it was laborous to find information about undecibility from that article. Also "Undecidable problem" article refers to "Decision problem" at the very begining so that if the reader does not understand the term he or she can check that out easily. 37.136.56.173 (talk) 10:27, 22 October 2013 (UTC)
HSCTF Participants should also be made aware that they should reverse the order of the first part and remove every other letter starting with removing the second to get their key. — Preceding unsigned comment added by Temptemptemp42 (talk • contribs) 01:59, 20 May 2014 (UTC)
I'm not sure if we should bother including it, as it is less useful, but I recently learned the following:
yes This loop is a trap!
Displays:
This loop is a trap!
This loop is a trap!
This loop is a trap!
...and so on. NickNackGus (talk) 02:25, 8 October 2014 (UTC)
In the above mentioned section of the article it is stated, that a signed integer would behave differently.
Now - correct me if I am wrong, but when I learned C and C++ (a little later), I was taught that on the level of bitwise arithmetic, a signed and unsigned int behave exactly the same.
Let's use a signed char (8-bit-int) for explanation:
Positive values range from 0 to 127 (0111'1111) and negative values from -128 (1000'0000) to -1 (1111'1111).
Now doing i++ on a value of 127 gives -128, but bitwise it's just a "+0000'0001", wrapping into the sign-bit and thus turning the number negative. That said, a signed or unsigned int (char or short or long or...) would do the exact same thing in the loop and thus reach the break-condition exactly the same.
Am I wrong?
— Preceding unsigned comment added by 62.153.114.18 (talk) 10:16, 19 November 2019 (UTC)
The following Wikimedia Commons file used on this page or its Wikidata item has been nominated for deletion:
Participate in the deletion discussion at the nomination page. —Community Tech bot (talk) 08:23, 8 August 2020 (UTC)
Someone should link this to an actual infinite loop (like the endless to infinite loop infinite loop mentioned earlier).
Nice. Got stuck in many loops. But, why put examples in archaic langauges? Also, JS is now a prominent language. Can you add JS examples?
(or I do) Learning With Ameer (talk) 10:54, 31 January 2023 (UTC)
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.