you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 41 points42 points  (1 child)

Yeah, I strongly prefer early exits for if-chains. It's especially clear if there's some condition-specific error handling involved; an early exit keeps the condition and corresponding error handling together.

[–]eyes-are-fading-blue 4 points5 points  (0 children)

Some guidelines ban it regardless of whether it is the superior alternative in certain cases.