Use Early Returns to Reduce Nesting
Problem
Deep nesting of if/else blocks makes code hard to follow — 3+ levels of indentation is a code smell.
Solution
Return early for edge cases and errors at the top of your function. The main logic stays flat at the base level.
Benefit
Reduces nesting from 3-4 levels to 0-1. Each condition is handled and exited immediately — much easier to read.