Method / Function Length

Methods / functions should be short, so that the cognitive load for each is low, and the lifetime of local variables is short. Ten lines or more should be rare. More than one level of indentation should be rare.

:-1:

 void doStuff() {
         // Initialize the foo
         ...
         ...
         ...
 
         //Call the bar
         ...
         ...
         ...
 
         //Cleanup the baz
         ...
         ...
         ...
 }

:+1:

 void doStuff() {
         initializeFoo()
         callBar()
         cleanUpBaz()
 }
 
 void initializeFoo() {
         ...
         ...
         ...
 }
 
 void callBar() {
         ...
         ...
         ...
 }
 
 void cleanUpBaz() {
         ...
         ...
         ...
 }

This allows a reader to quickly get an idea of what the code is doing, and they can choose how much detail they want to absorb by digging into the call chain as deeply as is necessary for their need. It also takes advantage of explaining names instead of noisy comments.