The Functional Style (2018)
Nevertheless, languages that are not designed for functional programming – I shall henceforth call them imperative languages – are all in some ways flawed for expressing functional code. I remember looking up functional programming when I first heard of it myself, and reading it explained in terms similar to this quote from Wikipedia:
In functional code, the output value of a function depends only on the arguments that are passed to the function, so calling a function f twice with the same value for an argument x produces the same result f(x) each time. Functional programmers refer to changes of state like that as side effects:
Eliminating side effects, i.e., changes in state that do not depend on the function inputs, can make it much easier to understand and predict the behavior of a program, which is one of the key motivations for the development of functional programming.
Source: codurance.com