Patterns of Bugs

bearophile bearophileHUGS at lycos.com
Sat Jan 8 06:37:51 PST 2011


Iain Buclaw:

> On the note of if statements. One pattern of bugs I see on the odd occasion are
> else statements written like this:
> 
> if (condition1)
>     if (condition2)
>         statement1;
>     else
>         statement2;
> 
> Always takes a moment or two to look again and realise it wouldn't work as
> expected without the missing braces added. ;)

See:
http://d.puremagic.com/issues/show_bug.cgi?id=4375
http://d.puremagic.com/issues/show_bug.cgi?id=4924
http://d.puremagic.com/issues/show_bug.cgi?id=4283

Bye,
bearophile


More information about the Digitalmars-d mailing list