Referential transparency is a key concept in functional programming. If most of your program uses pure functions, then it becomes much easier to do the following:
- Understand what a program is doing: You know that the function's return value only depends on its arguments. You do not have to think about what the state of this or that variable is in this or that context. You just have to look at the arguments.
- Test your functions: I will restate this point—the function's return value only depends on its argument. Testing it is very simple; you can try different argument values and confirm that the return value is what you expect.
- Write multithreaded programs: Since a pure function's behavior does not depend on a global state, ...