Functional programming organizes software around evaluations of functions while minimizing unnecessary side effects. Pure functions depend only on their arguments, always return the same result for the same inputs, and are easier to understand and control. Practical functional programming does not eliminate every side effect; it isolates actions that send messages, modify state, or otherwise depend on time. section 1.1 section 1.7
Use the central distinction between three kinds of code:
- Data is inert, transparent, easy to store, and easy to transmit. section 1.10
- Calculations produce values without depending on when or how often they run, making them easier to test, reuse, and understand. section 1.10 section 19.3
- Actions depend on time, ordering, or repetition, so isolate them and give them focused attention. section 1.38 section 19.3
Task completion and email
In a project-management service, marking a task complete and sending an email are actions. Deciding which users should receive notifications is a calculation, while the task, user, and notification details are data. Extracting the calculation from the email-sending action reduces the code whose behavior depends on time and makes the extracted logic easier to test. section 1.11 section 19.3
This perspective remains useful in object-oriented, procedural, and mixed codebases. It supports incremental refactoring rather than requiring a wholesale functional rewrite: identify actions, extract calculations, represent information as data, and concentrate safeguards around unavoidable effects. section 1.36 section 1.38


















