In my comment, I mentioned three advantages of functions: 1. They are easier to test and verify correctness. 2. Functions can be easily reused (sourced) in future scripts 3. Your boss likes them. And, never underestimate the importance of number 3. I would like to address one more issue: > ... so being able to arbitrarily swap the run order isn't something we > would generally be doing. For example, you wouldn't suddenly want to > put `declare_variables` after `walk_into_bar`, that would break things. To get the benefit of breaking code into functions, one should try to make the functions as independent as possible. If `walk_into_bar` requires a variable that is not used elsewhere, then that variable should be defined in and made local to `walk_into_bar`. The process of separating the code into functions and minimizing their inter-dependencies should make the code clearer and simpler. Ideally, functions should be easy to test individually. If, because of interactions, they are not easy to test, then that is a sign that they might benefit from refactoring.