the happy path flows down the left hand edge,
Tips for a good line of sight:
Align the happy path to the left; you should quickly be able to scan down one column to see the expected execution flow
Don’t hide happy path logic inside a nest of indented braces Exit early from your function Avoid else returns; consider flipping the if statement Put the happy return statement as the very last line Extract functions and methods to keep bodies small and readable If you need big indented bodies, consider giving them their own function
we indent only to deal with errors and edge cases,
our happy return statement “return nil” is in the last line, and
we have fewer indented code blocks.