Talk:Infinite loop: Difference between revisions

Content deleted Content added
syntaxhighlight & fix lint
 
(8 intermediate revisions by 7 users not shown)
Line 1:
{{WikiProject Computingbanner shell|class=Start|importance=}}
{{WikiProject Computer scienceComputing|importance=}}
{{WikiProject Computer science |importance=Mid}}
|class=Start
|importance=Mid
}}
{{Merged-from|Alderson loop}}
Line 113 ⟶ 112:
</syntaxhighlight>
 
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? <B>[[User:Tisane|<fontspan colorstyle="color:#008000;">Tisane</fontspan>]]</B> <sup>[[User talk:Tisane|talk]]</sup>/<sub>[[Special:Contributions/Tisane|stalk]]</sub> 15:33, 16 June 2010 (UTC)
 
:the rule is that every loop terminates, and when you pretend it doesn't like that, it makes the code harder to read. The example you gave is trivial, and all programming readability conventions can be ignored for trivial cases.
Line 178 ⟶ 177:
 
Maybe we could include it, but IDK what section. Thanks! [[Special:Contributions/68.173.113.106|68.173.113.106]] ([[User talk:68.173.113.106|talk]]) 21:46, 3 February 2012 (UTC)
 
:XD wow! Maybe replace with
:<code>while(true) {</code>
:<code>}</code>
:? [[User:Learning With Ameer|Learning With Ameer]] ([[User talk:Learning With Ameer|talk]]) 10:52, 31 January 2023 (UTC)
 
== Undefined Behaviour ==
Line 224 ⟶ 228:
Displays:
 
<codesyntaxhighlight lang="text">This loop is a trap!
 
This loop is a trap!
 
This loop is a trap!</codesyntaxhighlight>
 
...and so on.
Line 254 ⟶ 258:
== Infinite loops should be added somewhere ==
Someone should link this to an actual infinite loop (like the endless to infinite loop infinite loop mentioned earlier).
 
== Wow, where's JS? ==
 
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) [[User:Learning With Ameer|Learning With Ameer]] ([[User talk:Learning With Ameer|talk]]) 10:54, 31 January 2023 (UTC)