Why recognize side effects?
Side effects manipulate the state that is not the property of the function. Hence, when we look at the function in isolation, it is hard to assess whether the function has any negative implications on the application. This is not only true in unit tests; it is also cumbersome when it comes to mathematical proofs. Some big applications that must be secure can strive to build a mathematical model that is bullet-proof. Such apps are proved using math tools that go beyond the material of this book.
Side effects, when isolated, may work as data providers to our app. They can "inject" into the flow at the best moment, and from then on, data is treated as if it was just a variable. Going from one side effect free, function ...
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