Language matters. I don’t know about you, but I think the words used when speaking about functional programming (FP) have an elitist tinge to them. With FP, we are encouraged to use “pure” functions, which, of course, implies that we have been doing impure things all this time. I’m not a psychologist, but I bet this kind of talk can stimulate the subconscious into engaging in a bit of self-loathing for our impure transgressions.
And what about these “side effects” that we routinely traffic in? We know what the term “side effects” usually means: medicines are used for their beneficial intended effects, but we are warned against their many possibly pernicious “side effects.” But front end web developers write code that intentionally interacts with users and the real world, right? Because these interactions are intentional, they certainly are not “side effects” in the customary sense of the term. But in the language of FP, these are called “side effects,” which implies harmfulness. It seems like another attack at the very heart of what we do. Coders who are introduced to FP for the first time are hit with an immediate one-two punch!
With regard to variables, they are called variables because we expect them to vary, right? Now, what’s all this I hear about the harmfulness of “mutating” state variables? Here we go again…