7
$\begingroup$

When I was reviewing a book, I saw that there's a sentence claiming "side effect is a term coming from the domain of functional programming". I would think that the concept existed before the invention of the functional programming paradigm, but the author is asking for a citation that I was not able to find. Does the concept of "side-effect" actually predate functional programming, or is the author right?

$\endgroup$
4
  • $\begingroup$ I have no problem with the concept predating functional programming, it just seems that in order to understand functional programming one must acknowledge what a side effect is, (which the author seems to imply is taken for granted at times in non-functional programming). So the functional programmers use the term (side-effect) to name something that is taken for granted. To me it seems you have two ideas that you think are both apples when you really have an apple (defining a term) and an orange (the existence of a term). $\endgroup$
    – Guy Coder
    Sep 29, 2021 at 10:25
  • 2
    $\begingroup$ Drugs have been known to have side-effects for a long, long time. $\endgroup$ Sep 29, 2021 at 11:59
  • $\begingroup$ @GuyCoder yes, the concept obviously does exist without/before functional programming, but I am curious whether its definition also happened before the invention/definition of functional programming. $\endgroup$
    – kolistivra
    Sep 29, 2021 at 12:27
  • $\begingroup$ You seem to have fallen into a problem I find often with StackExchange questions. They ask the question in the title, elaborate a bit and end up asking a different question. I.e. Title: Does the concept of "side-effect" predate functional programming? - final question: is the author right? :) If you really want just an answer to a simple question then just ask the simple question without side effects. Pun intended. $\endgroup$
    – Guy Coder
    Sep 29, 2021 at 13:25

1 Answer 1

2
$\begingroup$

The term and intuitive notion of a side effect of course predates functional programming. So your question is really, does the meaning of side effect in programming languages (i.e., a function which has effects beyond its input-output behavior) date back to functional programming? To this I think the answer is yes for trivial reasons, if "functional programming" is interpreted broadly: the definition of a side effect is in terms of a function's input-output behavior, which is exactly the meaning of a functional program. So as long as people were studying side effects, they were doing so in contrast to pure functional programs.

It is also not easy to put a start date on the study of functional programming, which is why I adopt this broad view. Functional programming traces its roots back to Alonzo Church and the lambda calculus. At that time, people were already aware of the meaning of programs and the equivalence between different models of computation. The usage of the term side effect for programs entails an understanding of program input-output behavior which implies an understanding of what a purely functional program is.

For what it's worth, the earliest instance of "side effect" I could find in this usage, in papers indexed by Google Scholar, was in the study of LISP in the 1970s. Though I would not be surprised if there are earlier instances.

  • Output driven interpretation of recursive programs, or writing creates and destroys data structures, Friedman, Daniel P., and David S. Wise. Information Processing Letters, 1976. Paywalled link.
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.