Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use early return pattern to avoid nested conditions #639

Merged
merged 2 commits into from
Dec 12, 2022

Conversation

dsame
Copy link
Contributor

@dsame dsame commented Dec 8, 2022

Description:
Return early is the way of writing functions or methods so that the expected positive result is returned at the end of the function and the rest of the code terminates the execution (by returning or throwing an exception) when conditions are not met.

Related issue:
related issue.

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@dsame dsame force-pushed the v-sdolin/early-return branch from 3675013 to 676975d Compare December 9, 2022 10:42
@dsame dsame marked this pull request as ready for review December 9, 2022 10:48
@dsame dsame requested a review from a team December 9, 2022 10:48
@dsame dsame force-pushed the v-sdolin/early-return branch from d66f8a9 to d0c43c2 Compare December 9, 2022 11:31
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants