Day 1: Programming Without Mutable State
When programmers first encounter functional programming, their reaction is often one of disbeliefâthat it canât be possible to write nontrivial programs without modifying variables. Weâll see that it is not only possible but very often simpler and easier than creating normal imperative code.
The Perils of Mutable State
Today weâre going to concentrate on parallelism. Weâll construct a simple functional program and then show how, because itâs functional, itâs almost trivially easy to parallelize.
But first letâs look at a couple of examples in Java that show why itâs so helpful to avoid mutable state.
Hidden Mutable State
Hereâs a class that doesnât have any mutable state and ...
Get Seven Concurrency Models in Seven Weeks now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.