HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Does the concept of "side-effect" predate functional programming?

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
effectthesideconceptpredateprogrammingdoesfunctional

Problem

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?

Solution

The earliest usages of the term that I'm aware of are in regard to Algol 60, one of the first languages to be (or attempted to be) defined by a specification. When people started implementing it, they found that desirable optimizations (such as reordering expressions) could not be performed if the order of evaluation matters, which is possible only if side-effects are permitted. Also, side-effects may be considered mathematically inelegant, and one goal of the Algol effort was to produce a formal notation for algorithms.

Now, for some actual citations:

  • In “ALGOL 60 maintenance” (ALGOL bulletin 10, 1960), M. Woodger comments on the current draft of the specification, stating “It is quite unreasonable to allow the evaluation of expressions to induce side-effects”.



  • Samelson and Bauer (ALGOL bulletin 12, 1961) concur strongly, calling side-effects “preposterous”.



  • Dijkstra, on the other hand, in a letter to the editor, asserts that side-effects can be useful, e.g., in writing a random number generator.



  • Knuth, in “ALGOL 60 confidential” [Communications of the ACM 4(6), 1961], discusses the problem of side effects being poorly defined by the specification (it was unclear whether they were allowed or forbidden, and whether the order of evaluation was prescribed at all), although he does not use the term “side-effect”.



  • Knuth again, in “The remaining trouble spots in ALGOL 60” [Communications of the ACM 10(10), 1967] contains extensive commentary on side-effects and how they affect Algol 60 programmers and implementors.



Unrelated to Algol:

  • Leavenworth's “FORTRAN IV as a syntax language” [Communications of the ACM 7(2), 1964] considers how side-effects may be convenient alongside short-circuiting boolean expressions.



  • Abrahams et al., in “The LISP 2 programming language” [Proceedings of AFIPS '66], use the term in noting that their compiler always treats the order of evaluation as undefined, unless the code uses a special operator ORDER to force left-to-right.

Context

StackExchange Computer Science Q#144326, answer score: 3

Revisions (0)

No revisions yet.