From Recommendations To Write (Slightly More) Readable And (Thus) Robust Code:
- Exit early to avoid waterfall code. Especially for longer code blocks, this minimizes cognitive overhead.
The block statement is very handy to exit sections early, and allows to easily handle error codes. But your example might be to simple to illustrate the benefits.