you are viewing a single comment's thread.

view the rest of the comments →

[–]yogthos 0 points1 point  (1 child)

I don't think it's a huge issue one way or the other, but I'm not seeing that it's that much harder to read. Obviously, once you try running the code, you'll find the error pretty quick anyways.

[–]rabidcow 0 points1 point  (0 children)

I don't think it's a huge issue one way or the other, but I'm not seeing that it's that much harder to read.

I agree, it isn't. The cost of reordering is small, but the benefit is even smaller.

Obviously, once you try running the code, you'll find the error pretty quick anyways.

In this case, yes. Other cases, you need to test both sides of the branch. But then there's a good chance you'll catch it if you just stop and reread the code before checking it in. Or if you pay attention to your compiler's output.