Tech on Staging

  • Blog

Early Return

Aug 5, 2024

by

Muhamad Arif Adiputra

Possible way to solve nested if statements.

Basically just return if the result the negative of the clause in the if statements.

Reference:

  • Return Early To Reduce Deeply Nested If-Statements
  • Early returns vs nested positive if statements
  • Return Early Pattern
  • I’m very surprised that early returns are still commonly used …

Category: Uncategorized

←Prev
List All Version of Package in Choco
Next→
Deleting All Data in Table with Truncate vs Delete Command