3 ms·
Functional programming means working with referential transparency by definition and an expression is said to be referentially transparent if it can be changed
by bad_user 12y ago
Functional programming means working with referential transparency by definition and an expression is said to be referentially transparent if it can be changed with its value without changing the behavior of the program (i.e. you receive the same output for the same input). And that's actually the definition of functions in mathematics that children learn in school - functional programming does not refer to the "functions" that we know from regular imperative programming ;-)
This implies immutability, because pieces of code, or functions that mutate variables / objects / data-structures are NOT referentially transparent.
> I think fifty years of lisp would like to have a few words with this fellow
LISP is not really a family of FP programming languages, even though LISP in general does apply concepts from lambda calculus and does have everything needed for FP. LISP in general is more like a multipurpose swiss army knife. For example the style people use to develop in Common Lisp is often very far away from FP. There are exceptions of course, like Clojure, which comes with immutable data-structures by default, strived to make uncontrolled mutation more painful and the culture around it does encourage FP.