While making some fairly large changes recently, I frequently had to double-check that I'd understood control flow owing to outdented (left-margin) return statements.
I asked @davelab6 about this, and he agreed. I can see why it was done originally: it helps makes returns stand out in long functions. The real solution is not to write such long or complex functions.
Hence, in new code please indent return normally. Similarly, feel free to change existing statements when you're editing existing code (a good rule of thumb is to change them if they are in a + or - line of a diff).
I've added a note about this to the new web site's developer documentation.
While making some fairly large changes recently, I frequently had to double-check that I'd understood control flow owing to outdented (left-margin) return statements.
I asked @davelab6 about this, and he agreed. I can see why it was done originally: it helps makes returns stand out in long functions. The real solution is not to write such long or complex functions.
Hence, in new code please indent
returnnormally. Similarly, feel free to change existing statements when you're editing existing code (a good rule of thumb is to change them if they are in a+or-line of a diff).I've added a note about this to the new web site's developer documentation.