4 ms·
Thinking about it, I'd say the second one is better. I think it parse better in my mind as to what is meant. However I also always comment nested logic chains
by Coding_Cat 11y ago
Thinking about it, I'd say the second one is better. I think it parse better in my mind as to what is meant.
However I also always comment nested logic chains with their intent in plain language. I have made bugs in going from intent->complex logic to often, and I found that writing comments at each fork greatly reduces these errors as well as the odds of missing an edge case.
e.g., I'd write "if(a) and not b" in plain English at the nested else statement, possibly followed by a "what & why" comment at the do_thing_b statement.