Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    "while not adding any functions definitions etc. that would add conceptual complexity" You've added function definitions. Why do you think moving them outside Func2 would "add conceptual complexity"? The traditional advice would be to split up big functions into smaller functions, which you are doing here (you keep a lexically big function). Commented Oct 19, 2022 at 8:53
  • @Caleth Instead of "definitions" I should have said separate, nonlocal declaration + definition. Keeping code local and un-nested is something I find much more readable, within reason. Splitting things into functions has many benefits, but understanding things is not always one of them. In my example, the blocks are generally ~5-15 lines and I just prefer to keep blocks when it comes to short "procedures" that will not be reused elsewhere. Commented Oct 19, 2022 at 9:10
  • There's a school of thought that calls a 5 line function "long" Commented Oct 19, 2022 at 9:15