a-if

  • Blog

Early Return

Written by

Hotaru

at

2024-08-05 15:44:06 (GMT+0700)

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: Fixes

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