Abstract


  • Codes that are written in a way that makes it simple, concise, and expressive

Never Nester


Quote

If you need more than 3 levels of indentation, you’re screwed anyway, and should fix your program - Linux kernel style guidelines

  • The idea to to avoid deep nesting in program, to make code more readable and easier to maintain
  • There are two ways to avoid deep nesting - extraction & Inversion

Extraction

  • Extracts nested logic out and place it inside its own Function

Inversion

  • Replace if-else with return

References