Principles of Clean Functional Programming
summary
Practical rules and concrete examples show how to make functional code easier to read: prefer small named functions, factor out repetition, isolate IO and keep most functions pure, use higher‑order functions instead of recursion when possible, and avoid jumping out of and back into monads. Examples use Scala with some JavaScript; a slides image is runnable as docker run --rm --tip 80:8000 kbielefe/clean-fp and serves the examples. One surprising metric: a production microservice reports recursion zero times.
AI-written summary · about
chapters (24)
- 0:00Introduction
- 1:26About Karl
- 4:54General Notes
- 9:02Avoid Repetition
- 10:58Dont Nest Excessively
- 13:33JavaScript Example
- 15:02Pure Functions
- 16:33Example
- 20:55Pattern Matching
- 22:24When to use Pattern Matching
- 23:36Dont repeat yourself
- 25:40Dont overuse lambdas
- 26:06Dont use lambdas for everything
- 28:23Dont jump out and back in
- 28:46For comprehension
- 30:24For iteration
- 30:37Recursion
- 33:56When to use recursion
- 36:52Loop indices
- 39:15Factor out loop structures
- 39:43Tree traversal
- 41:14Relationships between objects
- 42:57Mutability
- 45:24Summary
related talks
56mBack to Basics: Functional Programming and Monads in C++
31mLet's get Functional (en)
25mEn route to better code
39mClean, Concise, Collaborative Code
53mMaintainable JavaScript with Functional Patterns
31mThe Importance of Clean Code
35mAvoiding code spaghetti by making ravioli
57mCore Software Design Principles for Programmers
