Chapter 3Functional Programming
Functional Programming is like a car powered by hydrogen fuel cells—advanced, futuristic, and not yet widely used, but it’s what we’ll all rely on in twenty years.
In contrast to an imperative program, which consists of a series of statements that change global state when executed, a functional program models computation as the evaluation of expressions. Those expressions are built from pure mathematical functions that are both first-class (can be manipulated like any other value) and side effect–free. It’s particularly useful when dealing with concurrency because the lack of side effects makes reasoning about thread safety much easier. It is also the first model we’ll look at that allows parallelism to be ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access