My computer programming education, and my focus as a programmer, was mostly on writing code rather than deeply understanding input and output data. This focus changed when I learned test-driven development (TDD), since this practice forces the programmer to start from inputs and outputs. Through applying an extreme form called TDD As If You Meant It, I gained a new appreciation for the core definition of a program—something that takes input data and returns output data.
It wasn't easy, though. My training was pushing me back to thinking of the things that form the program. But then, I realized that those things can just be pure functions. After all, any program can be written as follows:
- A set of pure functions, as previously defined
- A set of functions that interact with input/output (I/O)
If we reduce the program to the...