Things I Learnt The Hard Way - The Function Documentation Is Its Contract
When you start the code by writing the general flow as steps and making each step a function, you're actually making a contract (probably with your future self): I'm saying this function does this and this is what it does.