by ExpiredLink · 11y ago · 0 comments
Because that's good style!
> in the original if-else, the if in the else clause does not have a else
An if can live without an else. BTW, there are many books and online resources about programing style.
"Good style", "best practice", all of this comes from an observation made by somebody who can justify it is good practice by some real evidence. If you were using if-elseif like a switch statement, then maybe there should be an else. If the if conditions are not related, then I don't see why there should necessarily be one.
Please enlighten me by pointing to the relevant online resources.
What's left. What else should go in else?
BTW, the original example not disimproved by AutoRefactor was okay.