Else statements and early returns

The early return statement is useful. Indicating that there is no more processing increases readability significantly.

I think that the most readable approach is to have early return statements and else statements. The else statement highlights to the reader the alternative flow paths. The early return statements highlights to the reader the flow end.

This dual approach's greater readability outweighs the minor increase in duplication.

You'll only receive email when @T publishes a new post

More fromĀ @T