Functions as Black Boxes



In the early stages of designing a function it might be useful to think of a function as a black box.



The function purpose can give you some ideas for the function name.



Once you have those details resolved you can finally worry about what is required to convert the inputs into the desired output.



One advantage of the black box approach is that if you later decide to rewrite the function, you can seamlessly replace the old version with the new version as long as the function name, inputs (parameters), and output remain unchanged.