== Quote from torhu (n...@spam.invalid)'s article
> On 08.01.2011 15:13, Iain Buclaw wrote:
> >
> > 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. ;)
> But that one would actually work as expected, wouldn't it? ;) The else
> belongs to the second if, which matches your indentation.

Never let indentation fool you, the else clause will be assumed to be for the
first condition. :o)

Reply via email to