January 2018
Beginner to intermediate
312 pages
7h 22m
English
Functional programming techniques focus on making things explicit as much as possible, and this applies to error handling, too. We want to create functions that are explicit about whether they succeeded or not, and if they failed, what the error cases are.
All too often, errors are treated as second-class citizens in our code. But in order to have a robust, production-worthy system, we should treat errors as first-class citizens. And that goes double for errors that are part of the domain.
In the previous chapter, we used exceptions to raise errors. That was convenient, but it meant that all the function signatures were misleading. For example, the function to check an address had this signature: ...
Read now
Unlock full access