It probably happens because a lot of people aren't aware of exactly how "&&" type of statements get evaluated. For example, it is understandable for one to (mistakenly) think that
Java: |
if (x!=0 && (1/x)==3)
{
....
|
would lead to a division-by-zero error in the case that x==0 after all. Whereas the same person would have no problem with
Java: |
if (x!=0)
if ((1/x)==3)
{
.....
|
It's important to consciously be aware of the way the first if statement is evaluated. Once we have that, the rest follows 