if-expressions

pineapple via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 30 04:58:49 PDT 2016


On Sunday, 28 August 2016 at 16:17:31 UTC, Cauterite wrote:
> I dunno man, it seems all backwards to me. If you're gonna do 
> it this way, then you'd also want your if-statements like this:
>
> {
>     foo();
>     bar();
> } if (cond);
>
> Could you imagine trying to read a function you didn't write 
> yourself if branches were written like that?

Speaking of which, what's up with D's `do{ ... } while(...);`? 
Why not improve upon the convention and write `dowhile(...){}` or 
just `do(...){}`, or really anything that doesn't put the 
condition at the end?


More information about the Digitalmars-d mailing list