Introduction
Pure functions always give the same result for the same inputs and do not change anything outside themselves. This makes programs easier to understand and test.
When you want to write code that is easy to test and debug.
When you want to avoid unexpected changes in your program.
When you want to write functions that are predictable and reliable.
When you want to reuse code without side effects.
When you want to make your program easier to understand by others.