Click here to Skip to main content
15,886,788 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: while(true) is not fun Pin
BillWoodruff20-Sep-20 11:41
professionalBillWoodruff20-Sep-20 11:41 
GeneralRe: while(true) is not fun Pin
honey the codewitch20-Sep-20 11:45
mvahoney the codewitch20-Sep-20 11:45 
GeneralRe: while(true) is not fun Pin
trønderen21-Sep-20 2:42
trønderen21-Sep-20 2:42 
GeneralRe: while(true) is not fun Pin
honey the codewitch21-Sep-20 3:00
mvahoney the codewitch21-Sep-20 3:00 
GeneralRe: while(true) is not fun Pin
trønderen21-Sep-20 3:17
trønderen21-Sep-20 3:17 
GeneralRe: while(true) is not fun Pin
honey the codewitch21-Sep-20 3:39
mvahoney the codewitch21-Sep-20 3:39 
GeneralRe: while(true) is not fun Pin
Grant Rostig21-Sep-20 19:04
Grant Rostig21-Sep-20 19:04 
GeneralRe: while(true) is not fun Pin
trønderen22-Sep-20 0:24
trønderen22-Sep-20 0:24 
Looks as if someone has done a rather unsuccessful OCR of the Knuth paper Smile | :)

Preserving the indents and correcting the OCR errors (I should be 1, re should be m) make it look like
for i := 1 step 1 until m do.
   if A[i] = x then go to found fi;
not found: i := m+1; m := i;
A[i] := x; B[i] := 0;
found: B[i] := B[i]+1;
So, the for loop body is no more than the 'if .. goto' statement.

(Yet, even if this was in 1974, I am surprised that Knuth made that messy layout - especially the four statements after the 'not found' label. Structured statements came in Algol in 1960; Pascal arrived in 1970, so ideas of proper identetation and formatting shouldn't be new to him!)
GeneralRe: while(true) is not fun Pin
honey the codewitch22-Sep-20 4:34
mvahoney the codewitch22-Sep-20 4:34 
GeneralRe: while(true) is not fun Pin
Nelek20-Sep-20 20:31
protectorNelek20-Sep-20 20:31 
GeneralRe: while(true) is not fun Pin
Frank Malcolm24-Sep-20 12:40
Frank Malcolm24-Sep-20 12:40 
GeneralRe: while(true) is not fun Pin
BillWoodruff20-Sep-20 10:46
professionalBillWoodruff20-Sep-20 10:46 
GeneralRe: while(true) is not fun Pin
Member 448047420-Sep-20 19:36
Member 448047420-Sep-20 19:36 
GeneralRe: while(true) is not fun Pin
Member 1486610420-Sep-20 19:47
Member 1486610420-Sep-20 19:47 
GeneralRe: while(true) is not fun Pin
Wizard of Sleeves20-Sep-20 20:23
Wizard of Sleeves20-Sep-20 20:23 
GeneralRe: while(true) is not fun Pin
Rage20-Sep-20 21:01
professionalRage20-Sep-20 21:01 
GeneralGoto considered useful Pin
Martijn Smitshoek20-Sep-20 20:48
Martijn Smitshoek20-Sep-20 20:48 
GeneralRe: while(true) is not fun Pin
Rene Balvert20-Sep-20 20:48
Rene Balvert20-Sep-20 20:48 
GeneralRe: while(true) is not fun Pin
trønderen21-Sep-20 2:47
trønderen21-Sep-20 2:47 
GeneralRe: while(true) is not fun Pin
Bob Beechey20-Sep-20 20:49
Bob Beechey20-Sep-20 20:49 
GeneralRe: while(true) is not fun Pin
c6jones72020-Sep-20 22:21
c6jones72020-Sep-20 22:21 
GeneralRe: while(true) is not fun Pin
#realJSOP20-Sep-20 23:52
mve#realJSOP20-Sep-20 23:52 
GeneralRe: while(true) is not fun Pin
glennPattonWork320-Sep-20 23:55
professionalglennPattonWork320-Sep-20 23:55 
GeneralRe: while(true) is not fun Pin
Marc Clifton21-Sep-20 2:58
mvaMarc Clifton21-Sep-20 2:58 
GeneralRe: while(true) is not fun Pin
James Curran21-Sep-20 3:29
James Curran21-Sep-20 3:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.