Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Infinite loop
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Alderson loop=== ''Alderson loop'' is a rare slang or [[The Jargon File|jargon]] term for an infinite loop where there is an exit condition available, but inaccessible in an implementation of the code, typically due to a programmer error. These are most common and visible while [[debugging]] [[user interface]] code. A C-like pseudocode example of an Alderson loop, where the program is supposed to sum numbers given by the user until zero is given, but where the wrong operator is used: <syntaxhighlight lang="C"> int sum = 0; int i; 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 true, add i to the sum. Note: ZERO means FALSE, Non-Zero means TRUE. "i * 0" is ZERO (FALSE)! sum += i; // sum never changes because (i * 0) is 0 for any i; it would change if we had != in the condition instead of * } if (sum > 100) { break; // terminate the loop; exit condition exists but is never reached because sum is never added to } } </syntaxhighlight> The term allegedly received its name from a programmer (whose last name is Alderson) who in 1996<ref>{{cite web |url=https://www.lee-dohm.com/2013/05/24/alderson-loop |title=Alderson loop |author=Lee Dohm |date=May 24, 2013 |access-date=January 22, 2020 |archive-date=June 19, 2020 |archive-url=https://web.archive.org/web/20200619200434/https://www.lee-dohm.com/2013/05/24/alderson-loop/ |url-status=live }}</ref> had coded a [[modal window|modal]] [[dialog box]] in [[Microsoft Access]] without either an OK or Cancel button, thereby disabling the entire program whenever the box came up.<ref>{{Cite web |url=http://www.catb.org/~esr/jargon/html/A/Alderson-loop.html |title=Alderson Loop |website=[[The Jargon File]], Version 4.4.7 |url-status=live |archive-url=https://web.archive.org/web/20060515053043/http://www.catb.org/~esr/jargon/html/A/Alderson-loop.html |archive-date=2006-05-15 |access-date=2006-05-21}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)