I have to agree the infinitude of while () { ... } does seem a bit counterintuitive
I agree with your reaction, but not your conclusion. With while(1){ doing the intuitively obvious,
I can see absolutely no justification for equivalence between that and while(){
Seems most likely to be a bug that slipped through rather than a deliberate act; and remains because of some misguided backward compatibility justifiction; despite that no one in their right mind would code an infinite loop that way in order to save 1 character.
A bug masquerading as a feature is my assessment.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |
The source code from v1 seems to make it pretty clear it was deliberate, never a bug. I am with AnomalousMonk. While while(){} is an odd synonym at first blush for while(1){} the idea of ever writing while(){} to mean… all the enclosed code is just for laughs because I never want it to run is even sillier.
| [reply] [d/l] [select] |
the idea of ever writing while(){} to mean… all the enclosed code is just for laughs because I never want it to run is even sillier.
Hm. That would mean if( 0 ) & while( 0 ) were silly also, yet the Perl sources, amongst many others, are littered with innumerable examples of both.
Countering a conclusion, because it happens to have been drawn by me, is the very definition of "silly".
In every other case empty parens () mean false; to deem while() to mean the opposite, is...; well, it starts with s and is somewhat stronger than "silly".
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |