in reply to Thoughts on using subroutines to clean up code?

IMO, the key point when deciding to convert some piece of code into a helper subroutine is considering if there is a conceptual boundary around it. Can you put a name on that? are the input arguments and the outputs evident?

Another good question you could ask yourself is: when I come back to this code in a couple of months would I be able to understand the main subroutine just looking at it, without having to inspect the helper too?

  • Comment on Re: Thoughts on using subroutines to clean up code?