Chapter 10Error Handling
Murphy’s law says that if something can fail it will. Software systems will fail; errors are inevitable. The code we write should anticipate and properly react to errors that may happen at runtime. Error handling should not be an afterthought. The way you handle errors should depend on the application requirements and the code should align with those expectations. Whether we code in the imperative style or the functional style, proper error handling is our responsibility.
Functional style code is amazing, concise, less complex, and easy to work with...until we hit exception handling. Exception handling is fundamentally an imperative style of programming idea. Throwing exceptions is incompatible with functional programming. ...
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