When you are implementing a function, and you see the need for sub-functions (“helper functions”), just pretend these sub-functions already exist and use them in the main function.

Do not stop your train of thought and implement the sub function before returning to the main function to use it. Just use the sub-function as if it already exists! You won’t forget to implement the sub-functions because the compiler will prevent you from forgetting.

I call this breadth first thinking, because you are refusing to think about sub-functions until the main function’s logic is done. When doing breadth first thinking, you context switch your mind less, thus your speed of development is significantly increased.