On Apr 13, 2012, at 7:50 AM, Bernd Schmidt wrote:
> The problem is that a human might be
> confused, for example due to bad indentation. Whether there's a for in
> between doesn't matter for this purpose, the following is most likely a bug:
> 
> if ()
>  for (..)
>    if ()
>      x
> else
>  y

I like the warning only when the indentation of the else does not match the 
indentation of the matching if.  Most humans I think can follow the meaning 
correctly, if the code is indented correctly.  The point of the warning would 
be to catch typos, and an else that isn't in the right column, is most likely 
wrong.  Though, I'd argue that any else in the wrong column, is most likely 
wrong...

Reply via email to