Multilining if statement conditions is bad. I was modifying some code and came across this:
Which at a glance looks like this:
Single Line If
One person suggested that if someone had to do multiline the condition they could at least indent it. That's not much good either though:
Looks like this:
If Condition Then
You could one line the whole thing, which while I think is better than multi line conditionals, still isn't great as I cant see all of it on a normal sized screen (read "work supplied screen").
So, Why not just do it as suggested in Code Complete, which fits on my screen and explains the comparisons:
I don't know who wrote the above original code, and I don't much care either.
I do however think that the people who like the original style are clinically insane...and I work with at least one like this!
Some unit tests wouldn't go amiss either. Well, tests of any kind would be a good start...