foreach

Nick Sabalausky via Digitalmars-d digitalmars-d at puremagic.com
Sun Jun 15 00:05:37 PDT 2014


On 6/15/2014 2:21 AM, Walter Bright wrote:
> On 6/13/2014 10:03 AM, H. S. Teoh via Digitalmars-d wrote:
>> FWIW, I also see `for(;;)` as far better than `while(true)`. I like to
>> read `(;;)` as "ever", so it literally reads "forever { ... }". :-) (In
>> fact, in C/C++, you *could* #define ever (;;), then you can actually
>> write "for ever". (Un)fortunately, in D this is not possible.)
>
> Really, guys, the correct way to write an infinite loop is:
>
>   Loop:
>     ... statements ...
>     goto Loop;
>
> None of this candy-cane sugary stuff.

True story: I once had to put up with a production codebase (the 
company's *flagship* product) that wasn't asm (it was VB6) and yet was 
filled with garbage like this:

if ...cond... then
    ...statements...
    goto somelabel
end
...statements...
somelabel:

Got posted on thedailywtf for that one.



More information about the Digitalmars-d mailing list