BookBase
Functional Programming in Scala – Paul Chiusano, Rúnar Bjarnason könyvborító

Functional Programming in Scala

Paul Chiusano, Rúnar Bjarnason

66 min Audio available
Read it in the BookBase app

Free download · 500+ book summaries

What is Functional Programming in Scala about?

The type signature is a contract that tells you everything a function can and cannot do before you read a single line. This book shows that by removing one constraint (side effects), you can write everything else better. Error handling, parallelism, and I/O all have cleaner solutions. The payoff is code you can understand entirely on its own, without holding the entire system in your head.

Read an excerpt from the summary

Functional Programming in Scala — Summary

In 1969 a three-hundred-page novel appeared in Paris. A man vanishes in it, his friends go looking for him, and the trail leads nowhere. The critics liked it. One reviewer praised the prose at length and never once noticed what was strange about the text.

There is not a single letter "e" in it. In French. In a language where roughly every sixth keystroke is an "e". Georges Perec voluntarily took away the most common letter in his own language, and then wrote the novel out of what was left. The text did not get poorer for it. The missing letter forced him into solutions he would never have found on his own.

Paul Chiusano and Rúnar Bjarnason offer exactly this kind of bet, except the constraint is not on letters but on code. They forbid one single thing: your functions may not do anything behind your back. No writing to a file, no throwing an error, no overwriting a variable, no touching the screen. Nothing at all except computing a result from the input. On first hearing this sounds less like a constraint and more like an amputation.

And yet. Over several hundred pages the book shows that everything can still be written this way. Error handling, state, concurrency, files, the screen. There is a clean solution for each of them, and most of those solutions are better than the thing they replaced.

You get answers to three questions. How you can get anything done at all without the forbidden move. What you gain in exchange for giving it up. And most importantly: why this sharpens your thinking even if you never write a single line in the language the book's examples happen to use. Because this book is not about that language. The examples are in Scala, but the authors write plainly at the outset that the language is only a vehicle. The road goes somewhere else.

The summary of Functional Programming in Scala and 500+ more books await in the BookBase app.